/* ========================================
   GLASSMORPHISM PROFESSIONAL STYLE
   PUSMS - Glass Effect Theme avec couleurs du logo
   ======================================== */

:root {
    /* Logo colors - Université Sultan Moulay Slimane */
    --pusms-primary: #0087B7;        /* Main blue from logo */
    --pusms-secondary: #6c757d;
    --pusms-accent-orange: #ff6b35;  /* Orange from archway */
    --pusms-accent-green: #39ff14;   /* Vibrant green from wave */
    --pusms-success: #198754;
    --pusms-danger: #dc3545;
    --pusms-warning: #ffc107;
    --pusms-info: #0dcaf0;
    --pusms-dark-blue: #003d7a;      /* Darker blue for navbar */
    
    /* Cyan-blue - Couleur dominante du logo */
    --pusms-cyan-blue: #00B4D8;      /* Cyan vibrant - forme principale du logo */
    --pusms-cyan-light: #4DD0E1;     /* Cyan clair pour accents */
    --pusms-cyan-dark: #0096C7;      /* Cyan foncé pour profondeur */
    
    /* Glass effect variables */
    --glass-bg-cyan: rgba(0, 180, 216, 0.15);      /* Fond cyan transparent */
    --glass-bg-blue: rgba(0, 86, 179, 0.2);       /* Fond bleu transparent */
    --glass-bg-dark: rgba(0, 61, 122, 0.25);      /* Fond bleu foncé transparent */
    --glass-border: rgba(255, 255, 255, 0.18);    /* Bordure blanche subtile */
    --glass-shadow: 0 0px 10px rgba(0, 180, 216, 0.3); /* Ombre cyan */
    --glass-blur: blur(10px);
    --glass-blur-strong: blur(20px);
}

/* ========================================
   FIX OVERFLOW - Prévention du défilement horizontal
   ======================================== */
html {
    width: 100%;
    max-width: 100%;
}

/* Background avec dégradé animé utilisant les couleurs du logo */
body {
    margin: 0;
    padding: 0;
    background: rgb(255, 255, 255 / 50%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    position: relative;
    width: 100%;
    max-width: 100%;
}




/* Navbar avec effet glass */
.navbar {
    background: var(--pusms-primary) !important;
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    border-bottom: 1px solid rgba(128, 135, 255, 0.3);
    position: relative;
    z-index: 1000;
    height: 78px;
}

.navbar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background: linear-gradient(135deg, rgba(0, 61, 122, 0.3) 0%, rgba(0, 86, 179, 0.2) 100%);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur); */
    z-index: -1;
}

.logo-navbar {
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.logo-navbar:hover {
    transform: scale(1.05);
}

.navbar-brand {
    background: rgb(255, 255, 255 , 0.9);
    border-radius: 5px;
    font-size: 1.25rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.navbar-brand:hover {
    color: var(--pusms-accent-green) !important;
}

/* Sidebar avec effet glass - Flexible, s'adapte au contenu */
.sidebar {
    width: 280px;
    min-width: 280px;
    padding: 0;
    background: rgb(0 66 131 / 18%) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--glass-border);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
}

/* Container du logo dans la sidebar */
.sidebar-logo-container {
    /* padding: 1.5rem; */
    border-bottom: 1px solid var(--glass-border);
    background: rgb(209 221 233);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.sidebar-logo {
    max-width: 100%;
    height: auto;
    transition: transform 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

/* Container de navigation dans la sidebar */
.sidebar-nav-container {
    padding: 1rem 0;
}

/* Layout principal avec sidebar et contenu */
.main-layout {
    display: flex;
    flex-direction: row;
    min-height: 100vh;
    width: 100%;
    max-width: 100%;
}

/* Wrapper pour navbar et main content */
.content-wrapper {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0; /* Important pour flexbox - permet au contenu de se rétrécir */
    max-width: 100%;
}

/* Navbar - pleine largeur mais dans le layout flex */
.navbar-with-sidebar {
    width: 100%;
    max-width: 100%;
    min-width: 0; /* Permet au flexbox de gérer correctement la largeur */
}

/* Main content - prend l'espace restant */
.main-content-with-sidebar {
    flex: 1;
    padding: 1.5rem 0;
    min-width: 0; /* Important pour flexbox - permet au contenu de se rétrécir */
    max-width: 100%;
    overflow-x: hidden;
}

.sidebar .nav-link {
    color: rgba(0, 0, 0, 0.9);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin-bottom: 0.25rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid transparent;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: rgb(0, 0, 0);
    transform: translateX(5px);
    border-color: var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.2);
}

.sidebar .nav-link.active {
    background-color: var(--pusms-primary) !important;
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
}

.sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 20px;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

/* Cards avec effet glass */
.card {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 1rem;
    box-shadow: var(--glass-shadow);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    overflow: visible !important; /* Permet au dropdown de s'afficher correctement */
    position: relative;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.3);
}

.card-header {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--glass-border);
    font-weight: 600;
    color: rgba(0, 0, 0, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-body {
    color: rgba(0, 0, 0, 0.9);
}

/* Tables avec effet glass */
.table {
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.9);
}

.table th {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.8);
    border-bottom: 2px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.table td {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table-hover tbody tr:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Badges avec effet glass */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Buttons avec effet glass */
.btn {
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;

}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: rgb(0 66 131 / 76%) !important;
    color: white;
    box-shadow: 0 4px 15px rgba(0, 86, 179, 0.4);
}

.btn-primary:hover {
    background: linear-gradient(135deg, rgba(0, 61, 122, 0.8) 0%, rgba(0, 86, 179, 0.8) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.5);
}

.btn-outline-primary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(0, 86, 179, 0.5);
    color: rgba(0, 86, 179, 1);
}

.btn-outline-primary:hover {
    background: rgba(0, 86, 179, 0.3);
    border-color: rgba(0, 86, 179, 0.8);
    color: rgb(0, 0, 0);
}

.btn-success {
    background: rgba(25, 135, 84, 0.6) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.btn-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.6) 0%, rgba(0, 86, 179, 0.6) 100%) !important;
}

.btn-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.6) 0%, rgba(255, 107, 53, 0.6) 100%) !important;
    color: #000;
}

.btn-light {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(0, 0, 0, 0.9);
}

.btn-light:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    color: rgb(0, 0, 0);
}

.btn-outline-secondary {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(0, 0, 0, 0.9);
}

.btn-outline-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgb(0, 0, 0);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Forms avec effet glass */
.form-label {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: rgba(0, 0, 0, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Tous les types d'inputs avec bordures */
.form-control,
.form-select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="time"],
input[type="tel"],
input[type="url"],
input[type="search"],
input[type="color"],
input[type="range"],
input[type="file"] {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgb(0 0 0 / 47%) !important;
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    color: rgba(0, 0, 0, 0.9);
}

/* Placeholder en couleur noire pour tous les inputs */
.form-control::placeholder,
.form-select::placeholder,
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
input[type="number"]::placeholder,
input[type="date"]::placeholder,
input[type="datetime-local"]::placeholder,
input[type="time"]::placeholder,
input[type="tel"]::placeholder,
input[type="url"]::placeholder,
input[type="search"]::placeholder {
    color: rgba(0, 0, 0, 0.7) !important;
    opacity: 1;
}

/* Focus pour tous les inputs */
.form-control:focus,
.form-select:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="time"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
input[type="search"]:focus {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(0, 0, 0, 0.4) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
    color: rgb(0, 0, 0);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

.form-select-lg {
    padding: 0.875rem 2.5rem 0.875rem 1rem;
    font-size: 1rem;
}

/* Alerts avec effet glass */
.alert {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    box-shadow: var(--glass-shadow);
    color: rgba(0, 0, 0, 0.95);
}

.alert-success {
    background: rgba(25, 135, 84, 0.2) !important;
    border-color: rgba(25, 135, 84, 0.3);
}

.alert-danger {
    background: rgba(220, 53, 69, 0.2) !important;
    border-color: rgba(220, 53, 69, 0.3);
}

.alert-warning {
    background: rgba(255, 193, 7, 0.2) !important;
    border-color: rgba(255, 193, 7, 0.3);
}

.alert-info {
    background: rgba(13, 202, 240, 0.2) !important;
    border-color: rgba(13, 202, 240, 0.3);
}

/* Stats cards avec effet glass amélioré */
.card.text-white {
    border-radius: 1rem;
    border: 1px solid var(--glass-border) !important;
    position: relative;
    overflow: hidden;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    transition: all 0.3s ease;
}

.card.text-white::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    pointer-events: none;
    z-index: 0;
}

.card.text-white::after {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.card.text-white .card-body {
    padding: 1.5rem;
    position: relative;
    z-index: 1;
}

.card.text-white:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0, 180, 216, 0.4);
    border-color: rgba(255, 255, 255, 0.3) !important;
}

.card.bg-primary {
    background: linear-gradient(135deg, rgba(0, 86, 179, 0.4) 0%, rgba(0, 61, 122, 0.35) 100%) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    box-shadow: 0 8px 32px rgba(0, 86, 179, 0.4);
}

.card.bg-primary:hover {
    box-shadow: 0 12px 40px rgba(0, 86, 179, 0.5);
}

.card.bg-warning {
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.4) 0%, rgba(255, 107, 53, 0.35) 100%) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    box-shadow: 0 8px 32px rgba(255, 193, 7, 0.4);
}

.card.bg-warning:hover {
    box-shadow: 0 12px 40px rgba(255, 193, 7, 0.5);
}

.card.bg-info {
    background: linear-gradient(135deg, rgba(13, 202, 240, 0.4) 0%, rgba(0, 86, 179, 0.35) 100%) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    box-shadow: 0 8px 32px rgba(13, 202, 240, 0.4);
}

.card.bg-info:hover {
    box-shadow: 0 12px 40px rgba(13, 202, 240, 0.5);
}

.card.bg-success {
    background: linear-gradient(135deg, rgba(25, 135, 84, 0.4) 0%, rgba(57, 255, 20, 0.35) 100%) !important;
    backdrop-filter: var(--glass-blur) !important;
    -webkit-backdrop-filter: var(--glass-blur) !important;
    box-shadow: 0 8px 32px rgba(25, 135, 84, 0.4);
}

.card.bg-success:hover {
    box-shadow: 0 12px 40px rgba(25, 135, 84, 0.5);
}


/* Dropdown avec effet glass */
.dropdown-menu {
    background: rgba(255, 255, 255) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 0.5rem;
    z-index: 1045 !important; /* En dessous des modals */
}

.dropdown-item {
    color: rgba(0, 0, 0, 0.9);
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.2);
    color: rgb(0, 0, 0);
}

.dropdown-header {
    color: rgba(0, 0, 0, 0.7);
}

/* Fix pour dropdown dans les tableaux - permet au menu de s'afficher correctement */
.table-responsive {
    overflow-x: auto;
    overflow-y: visible !important; /* Permet au dropdown de s'afficher verticalement */
}

/* Assure que le dropdown dans les cellules de tableau s'affiche correctement */
.table td .dropdown {
    position: static; /* Permet au dropdown de se positionner par rapport au viewport */
}

.table td .dropdown-menu {
    position: absolute !important; /* Force le positionnement absolu */
    z-index: 1045 !important; /* En dessous des modals mais au-dessus du backdrop */
    margin-top: 0.125rem; /* Petit espacement depuis le bouton */
}

/* Fix pour les modals Bootstrap - s'assurer qu'ils sont visibles */
.modal {
    z-index: 1055 !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
}

.modal.show {
    display: block !important;
    opacity: 1 !important;
}

.modal.fade {
    transition: opacity 0.15s linear;
}

.modal.fade:not(.show) {
    opacity: 0;
}

.modal-backdrop {
    z-index: 1050 !important;
    background-color: rgba(0, 0, 0, 0.5) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important; /* Utilise right: 0 au lieu de width: 100vw */
    bottom: 0 !important; /* Utilise bottom: 0 au lieu de height: 100vh */
    width: 100% !important; /* Remplace 100vw par 100% pour éviter l'overflow */
    height: 100% !important; /* Remplace 100vh par 100% pour éviter l'overflow */
}

.modal-backdrop.show {
    opacity: 0.5 !important;
}

.modal-dialog {
    position: relative;
    margin: 1.75rem auto;
    max-width: 500px;
    pointer-events: none;
    z-index: 1056 !important;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff !important;
    background-clip: padding-box;
    border: 1px solid rgba(0, 0, 0, 0.2);
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    outline: 0;
    opacity: 1 !important;
}

/* Popovers et Tooltips - s'assurer qu'ils sont au-dessus des modals si nécessaire */


/* Text colors adjustments */
.text-muted {
    color: rgba(0, 0, 0, 0.7) !important;
}

h1, h2, h3, h4, h5, h6 {
    color: rgba(0, 0, 0, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

p {
    color: rgba(0, 0, 0, 0.9);
}

/* Info Card */
.info-card {
    border-left: 4px solid rgba(0, 180, 216, 0.5);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.info-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 180, 216, 0.2);
}

/* Main content area */
main {
    position: relative;
}

/* Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        min-width: 100%;
        order: 2; /* Sidebar apparaît en deuxième position */
    }
    
    .sidebar-logo {
        max-height: 60px;
    }
    
    .content-wrapper {
        width: 100%;
        display: contents; /* Le wrapper "disparaît" du flexbox, navbar et main deviennent enfants directs */
    }
    
    .navbar-with-sidebar {
        width: 100%;
        order: 1; /* Navbar en premier */
    }
    
    .main-content-with-sidebar {
        width: 100%;
        order: 3; /* Main content en troisième position */
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .logo-navbar {
        height: 50px !important;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    /* body {
        background-size: 200% 200%;
    } */
    
    .navbar {
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    
    .sidebar {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
    
    .card {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-in;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

/* Chat interface */
#chat-messages {
    max-height: 500px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 0.5rem;
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Form validation styles */
.was-validated .form-control:valid,
.was-validated .form-select:valid {
    border-color: rgba(25, 135, 84, 0.5);
    background: rgba(25, 135, 84, 0.1) !important;
}

.was-validated .form-control:invalid,
.was-validated .form-select:invalid {
    border-color: rgba(220, 53, 69, 0.5);
    background: rgba(220, 53, 69, 0.1) !important;
}

.invalid-feedback,
.valid-feedback {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

.invalid-feedback {
    color: rgba(220, 53, 69, 0.9);
}

.valid-feedback {
    color: rgba(25, 135, 84, 0.9);
}

/* Form text helper styling */
.form-text {
    color: rgba(0, 0, 0);
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* ========================================
   FORM PAGE STYLES - Reusable Components
   ======================================== */

/* Form Page Header avec effet glass */
.form-page-header {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.3) 0%, rgba(0, 61, 122, 0.3) 100%) !important;
    backdrop-filter: var(--glass-blur-strong);
    -webkit-backdrop-filter: var(--glass-blur-strong);
    color: white;
    padding: 2rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    margin-top: 2rem;
    box-shadow: var(--glass-shadow);
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
}

.form-page-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.form-page-header h1 {
    color: rgb(0, 0, 0);
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 1;
}

.form-page-header p {
    color: rgba(0, 0, 0, 0.9) !important;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

/* Info Card - For displaying related information */
.info-card {
    border-left: 4px solid var(--pusms-primary);
    transition: all 0.3s ease;
}

.info-card:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 86, 179, 0.15);
}

.info-card-icon {
    font-size: 2rem;
}

/* Form Card avec effet glass */
.form-card {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-top: 3px solid rgba(255, 107, 53, 0.5);
    box-shadow: var(--glass-shadow);
}

.form-card .card-header {
    background: rgba(255, 255, 255, 0.1) !important;
    border-bottom: 1px solid var(--glass-border);
    padding: 1.25rem 1.5rem;
}

.form-card .card-header h5 {
    color: rgba(0, 0, 0, 0.95);
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-card .card-header .text-muted {
    color: rgba(0, 0, 0, 0.7) !important;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Form Labels with Icons */
.form-label {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-label i {
    color: rgba(0, 0, 0, 0.9);
    font-size: 1rem;
}

/* Info Badge */
.info-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(0, 180, 216, 0.2);
    color: rgba(0, 0, 0, 0.9);
    border-radius: 0.375rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.info-badge i {
    color: rgba(0, 0, 0, 0.9);
}

/* Form Sections - For grouping form fields */
.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: rgba(0, 0, 0, 0.95);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.form-section-title i {
    color: rgba(0, 0, 0, 0.9);
}

/* Enhanced Textarea */
textarea.form-control {
    min-height: 120px;
    resize: vertical;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
}

textarea.form-control-large {
    min-height: 300px;
}

/* Form Actions - Button container */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    margin-top: 2rem;
    border-top: 2px solid rgba(255, 255, 255, 0.2);
}

/* Lot Items avec effet glass */
.lots-container {
    min-height: 100px;
}

.lot-item {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 1px solid var(--glass-border);
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.lot-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--pusms-primary);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.lot-item:hover {
    background: rgba(255, 255, 255, 0.15) !important;
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 24px rgba(0, 86, 179, 0.2);
    transform: translateY(-2px);
}

.lot-item:hover::before {
    transform: scaleY(1);
}

.lot-item-header {
    background: linear-gradient(135deg, rgba(0, 180, 216, 0.1) 0%, rgba(0, 86, 179, 0.05) 100%);
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lot-item-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: var(--pusms-primary);
    color: rgb(0, 0, 0);
    border-radius: 50%;
    font-weight: 600;
    font-size: 0.875rem;
}

.lot-item-title {
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.lot-item-title i {
    font-size: 1rem;
}

.lot-remove-btn {
    background: transparent;
    border: 2px solid var(--pusms-danger);
    color: var(--pusms-danger);
    border-radius: 0.5rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.lot-remove-btn:hover {
    background: var(--pusms-danger);
    color: rgb(0, 0, 0);
    transform: scale(1.05);
}

.lot-item-body {
    padding: 1.25rem;
}

.add-lot-btn {
    width: 100%;
    padding: 1rem;
    border: 2px dashed rgb(0 0 0 / 96%);
    background: rgba(255, 255, 255, 0.1);
    color: rgba(0, 0, 0, 0.9);
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.add-lot-btn:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(0, 180, 216, 0.2);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 180, 216, 0.2);
    color: rgb(0, 0, 0);
}

.add-lot-btn i {
    font-size: 1.25rem;
}

.lots-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 0.75rem;
    background: rgb(165 165 165 / 61%);
    margin-bottom: 1rem;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.lots-empty-state i {
    font-size: 3rem;
    color: rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem;
}

.lots-empty-state p {
    color: rgba(0, 0, 0, 0.7);
    margin: 0;
    font-size: 0.95rem;
}

.lot-percentage {
    background-color: rgba(255, 255, 255, 0.1);
    font-weight: 600;
    color: rgba(0, 0, 0, 0.9);
    cursor: not-allowed;
}

.lot-item {
    animation: slideIn 0.3s ease-out;
}

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

/* Icon Circle Background */
.icon-circle {
    background: rgba(0, 180, 216, 0.2);
    border-radius: 50%;
    padding: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.icon-circle i {
    color: rgba(0, 0, 0, 0.9);
}

.icon-circle-large {
    padding: 1.5rem;
}

.icon-circle-large i {
    font-size: 2rem;
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.2);
}

.page-header h1 {
    margin: 0;
    color: rgba(0, 0, 0, 0.95);
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-header h1 i {
    color: rgba(0, 0, 0, 0.9);
    margin-right: 0.5rem;
}

/* Enhanced Card Styles */
.card-shadow {
    box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 86, 179, 0.15);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.empty-state i {
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.3);
    margin-bottom: 1rem;
}

.empty-state h5 {
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 0.5rem;
}

/* Messages d'erreur de validation */
.invalid-feedback {
    display: block !important;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.invalid-feedback .text-danger {
    color: rgba(220, 53, 69, 0.9) !important;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.invalid-feedback .text-danger i {
    font-size: 1rem;
    margin-right: 0.25rem;
}

.form-control.is-invalid,
.form-control:invalid {
    border-color: #dc3545;
    padding-right: calc(1.5em + 0.75rem);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23dc3545'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath d='m5.8 3.6 .4.4.4-.4m0 4.8-.4-.4-.4.4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
}

.form-control.is-invalid:focus,
.form-control:invalid:focus {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.25rem rgba(220, 53, 69, 0.25);
}

/* Messages d'erreur personnalisés */
.error-message {
    color: rgba(220, 53, 69, 0.9);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
}

.error-message i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Print styles */
@media print {
    /* body {
        background: white !important;
    } */
    
    .sidebar,
    .navbar,
    .btn,
    .card-header {
        display: none !important;
    }
    
    .card {
        border: 1px solid #ddd;
        box-shadow: none;
        background: white !important;
    }
    
    h1, h2, h3, h4, h5, h6, p {
        color: #212529 !important;
    }
}

/* ========================================
   LOGIN PAGE - PROFESSIONAL DESIGN
   Animated Background + Glass Effect
   ======================================== */

.login-page-wrapper {
    position: relative;
    min-height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #6380ff 0%, #c8c7c9 50%, #4facfe 100%);
}

/* Animated floating shapes */
.animated-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    animation: float 20s infinite ease-in-out;
}

.shape-1 {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
    animation-delay: 0s;
}

.shape-2 {
    width: 200px;
    height: 200px;
    top: 20%;
    right: -50px;
    animation-delay: 2s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    bottom: 10%;
    left: 10%;
    animation-delay: 4s;
}

.shape-4 {
    width: 150px;
    height: 150px;
    top: 60%;
    right: 20%;
    animation-delay: 6s;
}

.shape-5 {
    width: 180px;
    height: 180px;
    bottom: -50px;
    right: -50px;
    animation-delay: 8s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, 50px) rotate(90deg);
    }
    50% {
        transform: translate(-30px, 100px) rotate(180deg);
    }
    75% {
        transform: translate(30px, -50px) rotate(270deg);
    }
}

/* Glass effect card */
.login-glass-card {
    background: rgba(255, 255, 255, 0.15) !important;
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 20px;
    box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
    overflow: hidden;
}

.login-glass-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
}

.login-glass-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px 0 rgba(31, 38, 135, 0.5);
    border-color: rgba(255, 255, 255, 0.4);
}

.login-logo {
    width: 100%;
    max-width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
    object-fit: contain;
}

.login-logo:hover {
    transform: scale(1.02);
}

/* Glass alerts */
.glass-alert {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white !important;
}

.glass-alert.alert-danger {
    background: rgba(220, 53, 69, 0.3) !important;
    border-color: rgba(220, 53, 69, 0.5);
}

.glass-alert.alert-success {
    background: rgba(25, 135, 84, 0.3) !important;
    border-color: rgba(25, 135, 84, 0.5);
}

/* Glass form inputs */
.login-form .form-label {
    color: rgba(255, 255, 255, 0.95);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: 600;
}

.glass-input-group {
    position: relative;
}

.glass-input-icon {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-right: none !important;
    color: white !important;
    border-radius: 12px 0 0 12px !important;
}

.glass-input {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-left: none !important;
    color: #2c3e50 !important;
    border-radius: 0 12px 12px 0 !important;
    transition: all 0.3s ease;
    font-weight: 500;
}

.glass-input::placeholder {
    color: rgba(44, 62, 80, 0.6) !important;
}

.glass-input:focus {
    background: rgba(255, 255, 255, 0.35) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    color: #1a252f !important;
    outline: none;
}

/* Password toggle button */
.glass-toggle-password {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-left: none !important;
    color: white !important;
    border-radius: 0 12px 12px 0 !important;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0.5rem 0.75rem;
}

.glass-toggle-password:hover {
    background: rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

.glass-toggle-password:focus {
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

/* Adjust password input when toggle button is present */
.glass-input-group .glass-input[id="inputPassword"] {
    border-right: none !important;
    border-radius: 0 !important;
}

/* Glass button - More prominent with brand colors */
.glass-button {
    background: linear-gradient(135deg, var(--pusms-primary) 0%, var(--pusms-cyan-blue) 100%) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 135, 183, 0.4);
}

.glass-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.glass-button:hover::before {
    left: 100%;
}

.glass-button:hover {
    background: linear-gradient(135deg, var(--pusms-cyan-blue) 0%, var(--pusms-primary) 100%) !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 135, 183, 0.6);
    border-color: rgba(255, 255, 255, 0.5) !important;
}

.glass-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.glass-button .btn-loading {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.glass-button:active {
    transform: translateY(0);
}

/* Remember me checkbox */
.glass-checkbox {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.glass-checkbox:checked {
    background-color: var(--pusms-primary) !important;
    border-color: var(--pusms-primary) !important;
}

.glass-checkbox:focus {
    border-color: rgba(255, 255, 255, 0.5) !important;
    box-shadow: 0 0 0 0.2rem rgba(255, 255, 255, 0.25);
    outline: none;
}

/* Forgot password link */
.forgot-password-link {
    font-size: 0.9rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.forgot-password-link:hover {
    opacity: 1;
    text-decoration: underline !important;
    color: rgba(255, 255, 255, 1) !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .login-glass-card {
        margin: 1rem;
    }
    
    .shape {
        opacity: 0.5;
    }

    .login-logo {
        max-height: 150px;
    }
}

