/* ===================================
   RESET & BASE
   =================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #003d7a;
    --color-primary-dark: #002952;
    --color-secondary: #0066cc;
    --color-success: #4caf50;
    --color-warning: #ff9800;
    --color-danger: #f44336;
    --color-info: #2196f3;
    --color-gray-100: #f5f5f5;
    --color-gray-200: #eeeeee;
    --color-gray-300: #e0e0e0;
    --color-gray-400: #bdbdbd;
    --color-gray-600: #757575;
    --color-gray-800: #424242;
    --color-gray-900: #212121;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 20px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.2s ease;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--color-gray-100);
    color: var(--color-gray-900);
    line-height: 1.6;
    min-height: 100vh;
}

/* ===================================
   HEADER
   =================================== */
.main-header {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    gap: 30px;
}

.header-left .logo h1 {
    font-size: 1.5rem;
    margin-bottom: 2px;
}

.header-left .logo .subtitle {
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
}

.main-nav {
    display: flex;
    gap: 5px;
    flex: 1;
    justify-content: center;
}

.main-nav a {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    white-space: nowrap;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.1);
}

.main-nav a.active {
    background: rgba(255, 255, 255, 0.2);
}

.header-right .user-menu {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    margin-bottom: 2px;
}

.user-role {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 8px;
}

/* ================================
   LOGO DANS LE HEADER
================================ */

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-img {
    height: 100px; /*Base 50 */
    width: auto;
    object-fit: contain;
}

.logo-text h1 {
    margin: 0;
    font-size: 1.5rem;
    color: #f7f9fc;
    font-weight: 700;
}

.logo-text .subtitle {
    display: block;
    font-size: 0.75rem;
    color: #7f8c8d;
    margin-top: 2px;
}

/* Responsive : Logo plus petit sur mobile */
@media (max-width: 768px) {
    .logo-img {
        height: 35px;
    }
    
    .logo-text h1 {
        font-size: 1.2rem;
    }
    
    .logo-text .subtitle {
        font-size: 0.65rem;
    }
}


/* ===================================
   CONTAINER
   =================================== */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* ===================================
   CARDS
   =================================== */
.card {
    background: white;
    border-radius: var(--border-radius);
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--color-gray-200);
}

.card-header h2 {
    font-size: 1.5rem;
    color: var(--color-primary);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    border-left: 4px solid var(--color-gray-300);
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stat-card.alert {
    border-left-color: var(--color-warning);
}

.stat-card.success {
    border-left-color: var(--color-success);
}

.stat-card.info {
    border-left-color: var(--color-info);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 10px;
    line-height: 1;
}

.stat-label {
    font-size: 1rem;
    color: var(--color-gray-600);
    margin-bottom: 15px;
}

.stat-link {
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 10px;
    transition: var(--transition);
}

.stat-link:hover {
    color: var(--color-secondary);
}

/* ===================================
   TABLES
   =================================== */
.table-responsive {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.table thead {
    background: var(--color-primary);
    color: white;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-gray-200);
}

.table th {
    font-weight: 600;
    white-space: nowrap;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background: var(--color-gray-100);
}

.table tbody tr:last-child td {
    border-bottom: none;
}

.table-compact td,
.table-compact th {
    padding: 8px 12px;
    font-size: 0.9rem;
}

/* ===================================
   BUTTONS
   =================================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 0.95rem;
    text-align: center;
}

.btn:hover {
    background: var(--color-primary-dark);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary { background: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); }

.btn-success { background: var(--color-success); }
.btn-success:hover { background: #45a049; }

.btn-danger { background: var(--color-danger); }
.btn-danger:hover { background: #da190b; }

.btn-warning { background: var(--color-warning); }
.btn-warning:hover { background: #e68900); }

.btn-info { background: var(--color-info); }
.btn-info:hover { background: #0b7dda; }

.btn-sm {
    padding: 6px 14px;
    font-size: 0.85rem;
}

.btn-block {
    width: 100%;
    display: block;
}

.btn-logout {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-logout:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* ===================================
   BADGES
   =================================== */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.badge-en_attente {
    background: #fff3cd;
    color: #856404;
}

.badge-valide {
    background: #d4edda;
    color: #155724;
}

.badge-refuse {
    background: #f8d7da;
    color: #721c24;
}

.badge-planifie {
    background: #d1ecf1;
    color: #0c5460;
}

.badge-en_cours {
    background: #fff3cd;
    color: #856404;
}

.badge-termine {
    background: #d4edda;
    color: #155724;
}

.badge-archive {
    background: #e2e3e5;
    color: #383d41;
}

/* ===================================
   PROGRESS BAR
   =================================== */
.progress-container {
    position: relative;
    width: 150px;
    height: 25px;
    background: var(--color-gray-200);
    border-radius: 12px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--color-success), #66bb6a);
    transition: width 0.3s ease;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-gray-900);
}

/* ===================================
   FORMS
   =================================== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--color-gray-800);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-gray-300);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
}

/* ===================================
   EMPTY STATE
   =================================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-gray-600);
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* ===================================
   PAGE HEADER
   =================================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
}

.subtitle {
    font-size: 1rem;
    color: var(--color-gray-600);
    font-weight: 400;
}

.date-display {
    background: white;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    font-weight: 600;
    color: var(--color-primary);
    box-shadow: var(--shadow-sm);
}

/* ===================================
   ALERTS
   =================================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border-left-color: var(--color-success);
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border-left-color: var(--color-danger);
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border-left-color: var(--color-warning);
}

.alert-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left-color: var(--color-info);
}

/* ===================================
   LOGIN PAGE
   =================================== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-box {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.login-header p {
    color: var(--color-gray-600);
}

.login-footer {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--color-gray-300);
    text-align: center;
    font-size: 0.9rem;
    color: var(--color-gray-600);
}

.login-footer p {
    margin-bottom: 5px;
}

/* ===================================
   FILTERS
   =================================== */
.filters {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filters .btn {
    background: white;
    color: var(--color-primary);
    border: 2px solid var(--color-gray-300);
}

.filters .btn:hover {
    background: var(--color-gray-100);
    border-color: var(--color-primary);
}

.filters .btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

/* ===================================
   MODAL
   =================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: white;
    margin: 3% auto;
    padding: 30px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--border-radius);
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: slideDown 0.3s;
}

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

.modal-content.modal-large {
    max-width: 900px;
}

.modal-content h2 {
    color: var(--color-primary);
    margin-bottom: 25px;
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    color: var(--color-gray-600);
    line-height: 1;
    transition: var(--transition);
}

.close:hover {
    color: var(--color-danger);
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 1024px) {
    .main-header .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .main-nav {
        justify-content: flex-start;
        overflow-x: auto;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .table {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 8px;
    }
    
    .main-nav {
        flex-direction: column;
        width: 100%;
    }
    
    .main-nav a {
        width: 100%;
        text-align: center;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
        margin: 10% auto;
    }
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.hidden { display: none; }

/* ================================
   BOUTONS D'ACTION
================================ */

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #e67e22;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

/* Icônes dans les boutons */
.btn-sm {
    padding: 5px 10px;
    font-size: 0.9rem;
    min-width: 35px;
}

/* === MENU UTILISATEUR AMÉLIORÉ === */
.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.user-btn:hover {
    background: #f8f9fa;
    border-color: #0066cc;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,102,204,0.1);
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: #666;
    text-transform: capitalize;
}

.dropdown-arrow {
    color: #666;
    font-size: 10px;
    transition: transform 0.3s ease;
}

.user-btn:hover .dropdown-arrow {
    color: #0066cc;
}

/* Menu déroulant */
.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 15px;
    background: linear-gradient(135deg, #0066cc 0%, #0052a3 100%);
    color: white;
    border-radius: 8px 8px 0 0;
}

.dropdown-header strong {
    display: block;
    font-size: 15px;
    margin-bottom: 4px;
}

.dropdown-header small {
    display: block;
    opacity: 0.9;
    font-size: 12px;
}

.user-dropdown hr {
    margin: 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #0066cc;
}

.dropdown-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.logout-item {
    color: #dc3545;
}

.logout-item:hover {
    background: #fff5f5;
    color: #c82333;
}

/* Animation de rotation de la flèche */
.user-dropdown.show ~ .user-btn .dropdown-arrow {
    transform: rotate(180deg);
}

/* Responsive */
@media (max-width: 768px) {
    .user-btn {
        padding: 6px 12px;
    }
    
    .user-info {
        display: none;
    }
    
    .user-btn::before {
        content: "👤";
        font-size: 20px;
    }
    
    .dropdown-arrow {
        display: none;
    }
}







/* ===================================
   PAGE CHANGEMENT MOT DE PASSE
   =================================== */

.justify-content-center {
    display: flex;
    justify-content: center;
}

.col-md-6 {
    width: 100%;
    max-width: 600px;
}

.mb-3 {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #495057;
    font-size: 14px;
}

.toggle-password {
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 0.7;
}

#strength-indicator {
    animation: fadeIn 0.3s;
}

#match-indicator {
    display: block;
    margin-top: 8px;
    font-weight: 500;
    animation: fadeIn 0.3s;
}

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

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-info strong {
    color: #0c5460;
}

.alert-info ul li {
    margin: 5px 0;
}
