/* ========== IMPORTS & VARIABLES ========== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --bordeaux: #A94064;
    --bordeaux-light: #c25881;
    --bleu-canard: #00567A;
    --bleu-canard-light: #007ba3;
    --blanc: #FFFFFF;
    --gris-clair: #F5F7FA;
    --gris-moyen: #8B95A5;
    --gris-fonce: #2C3E50;
    --ombre-legere: 0 2px 8px rgba(0, 0, 0, 0.08);
    --ombre-forte: 0 8px 24px rgba(0, 0, 0, 0.12);
    --page-max-width: 1400px;
    --app-max-width: 1400px;
    --navbar-height: 90px;
    --page-padding-top: 110px;
    --app-padding-top: 110px;
    --app-padding-x: 2rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f0f4f8 0%, #e2e8f0 100%);
    color: var(--gris-fonce);
    min-height: 100vh;
    display: block;
    padding: 0;
    margin: 0;
    line-height: 1.6;
}

/* ========== CONTAINER ========== */
.container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* ========== HEADER ========== */
.header {
    text-align: center;
    margin-bottom: 4rem;
    animation: fadeInDown 0.8s ease-out;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    max-width: 280px;
    height: auto;
    margin-bottom: 2rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.header h1 {
    font-size: 2.8rem;
    color: var(--bleu-canard);
    margin-bottom: 0.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    font-size: 1.3rem;
    color: var(--bordeaux);
    font-weight: 500;
}

/* ========== MAIN CONTENT ========== */
.main-content {
    margin-bottom: 3rem;
}

.cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 2.5rem;
    padding: 1rem;
}

/* ========== CARDS ========== */
.card {
    background: var(--blanc);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--ombre-legere);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--bleu-canard), var(--bordeaux));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.card:hover::before {
    transform: scaleX(1);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ombre-forte);
}

.card-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card h2 {
    font-size: 1.6rem;
    color: var(--bleu-canard);
    margin-bottom: 1.2rem;
    font-weight: 700;
}

.card p {
    color: var(--gris-moyen);
    margin-bottom: 2rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* ========== BUTTONS ========== */
.btn {
    padding: 1rem 2.5rem;
    font-size: 1.05rem;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    width: 100%;
    max-width: 280px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::after {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--bleu-canard) 0%, var(--bleu-canard-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 86, 122, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 122, 0.4);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--bordeaux) 0%, var(--bordeaux-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(169, 64, 100, 0.3);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(169, 64, 100, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* ========== FOOTER ========== */
.footer {
    text-align: center;
    padding: 2.5rem 0 1rem;
    color: var(--gris-moyen);
    font-size: 0.95rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    margin-top: 2rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 900px) {
    .cards-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    .logo {
        max-width: 220px;
    }
    
    .card {
        padding: 2.5rem 2rem;
    }
    
    .card h2 {
        font-size: 1.4rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }
    
    .header h1 {
        font-size: 1.6rem;
    }
    
    .btn {
        max-width: 100%;
    }
}

/* ========== PAGE DE CONNEXION ========== */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
}

.back-link {
    position: absolute;
    top: 2rem;
    left: 2rem;
    color: var(--bleu-canard);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link:hover {
    color: var(--bordeaux);
    transform: translateX(-5px);
}

.login-card {
    background: var(--blanc);
    border-radius: 20px;
    padding: 3rem;
    box-shadow: var(--ombre-forte);
    max-width: 480px;
    width: 100%;
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-size: 2rem;
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.login-subtitle {
    color: var(--bordeaux);
    font-size: 1rem;
    font-weight: 500;
}

/* ========== FORMULAIRE ========== */
.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gris-fonce);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: var(--gris-clair);
}

.form-group input:focus {
    outline: none;
    border-color: var(--bleu-canard);
    background: var(--blanc);
    box-shadow: 0 0 0 3px rgba(0, 86, 122, 0.1);
}

.form-group input::placeholder {
    color: var(--gris-moyen);
}

/* ========== BOUTON DE CONNEXION ========== */
.btn-login {
    width: 100%;
    max-width: none;
    display: block;
    padding: 1rem;
    background: linear-gradient(135deg, var(--bleu-canard) 0%, var(--bleu-canard-light) 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 86, 122, 0.3);
    margin-top: 1rem;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 86, 122, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* ========== ALERTES ========== */
.alert {
    padding: 1rem 1.2rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* ========== INFO BOX ========== */
.info-box {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
}

.info-box small {
    color: #1e40af;
    line-height: 1.6;
}

/* ========== RESPONSIVE LOGIN ========== */
@media (max-width: 768px) {
    .login-card {
        padding: 2rem 1.5rem;
    }
    
    .login-logo {
        max-width: 160px;
    }
    
    .login-header h1 {
        font-size: 1.6rem;
    }
    
    .back-link {
        top: 1rem;
        left: 1rem;
        font-size: 0.9rem;
    }
}
/* ========== NAVBAR ========== */
.navbar {
    background: var(--blanc);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    border-bottom: 3px solid transparent;
    border-image: linear-gradient(90deg, var(--bleu-canard), var(--bordeaux)) 1;
}

.navbar-container {
    width: 100%;
    padding: 0 2.5rem;
    height: var(--navbar-height);
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Logo + titre (gauche) */
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
    text-decoration: none;
}

.navbar-logo {
    height: 54px;
    width: auto;
}

.navbar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--bleu-canard);
    white-space: nowrap;
}

/* Liens nav — gauche, juste après le logo */
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    flex: 1;
}

/* Zone utilisateur — extrême droite */
.navbar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.user-welcome {
    color: var(--gris-fonce);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.4rem 0.9rem;
    background: var(--gris-clair);
    border-radius: 20px;
    white-space: nowrap;
}

.btn-logout {
    padding: 0.5rem 1.2rem;
    background: linear-gradient(135deg, var(--bordeaux) 0%, var(--bordeaux-light) 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-logout:hover {
    background: linear-gradient(135deg, var(--bordeaux-light) 0%, var(--bordeaux) 100%);
}

@media (max-width: 1200px) {
    .navbar-container { padding: 0 1.5rem; gap: 1rem; }
    .navbar-title { display: none; }
}

@media (max-width: 900px) {
    .navbar-container { padding: 0 1rem; }
    .navbar-logo { height: 44px; }
    .user-welcome { display: none; }
}

@media (max-width: 640px) {
    .navbar-logo { height: 36px; }
    .btn-logout { padding: 0.4rem 0.8rem; font-size: 0.82rem; }
}
/* ========== DASHBOARD CONTAINER ========== */
.dashboard-container {
    max-width: var(--page-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: var(--page-padding-top);
}
.dashboard-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.dashboard-header h1 {
    font-size: 2.5rem;
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.dashboard-subtitle {
    font-size: 1.2rem;
    color: var(--gris-moyen);
}

/* ========== DASHBOARD CARDS ========== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

.dashboard-card {
    background: var(--blanc);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: var(--ombre-legere);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--bleu-canard), var(--bordeaux));
    transform: scaleX(0);
    transition: transform 0.4s ease;
}

.dashboard-card:hover::before {
    transform: scaleX(1);
}

.dashboard-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--ombre-forte);
}

/* ========== FEATURES LIST ========== */
.features-list {
    list-style: none;
    margin: 1.5rem 0 2rem 0;
    padding: 0;
}

.features-list li {
    padding: 0.5rem 0;
    color: var(--gris-fonce);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ========== DASHBOARD STATS ========== */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--blanc) 0%, var(--gris-clair) 100%);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    box-shadow: var(--ombre-legere);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--bleu-canard), var(--bordeaux));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: var(--gris-moyen);
    font-size: 0.95rem;
    font-weight: 500;
}

/* ========== RESPONSIVE DASHBOARD ========== */
@media (max-width: 900px) {
    .dashboard-cards {
        grid-template-columns: 1fr;
    }
    
    .navbar-title {
        display: none;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        padding: 2rem 1rem;
    }
    
    .dashboard-header h1 {
        font-size: 2rem;
    }
    
    .navbar-container {
        padding: 1rem;
    }
    
    .navbar-logo {
        height: 40px;
    }
    
    .user-welcome {
        font-size: 0.85rem;
    }
    
    .btn-logout {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .user-welcome {
        display: none;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
}


/* ========== NAV LINK ========== */
.nav-link {
    color: var(--bleu-canard);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.92rem;
    transition: background 0.15s, color 0.15s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    white-space: nowrap;
}

.nav-link:hover {
    background: var(--gris-clair);
    color: var(--bordeaux);
}

/* ========== MODULE CONTAINER ========== */
.module-container {
    max-width: var(--page-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: var(--page-padding-top);
}
.module-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeInDown 0.6s ease-out;
}

.module-header h1 {
    font-size: 2.5rem;
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.module-subtitle {
    font-size: 1.2rem;
    color: var(--gris-moyen);
}

/* ========== CONSTRUCTION CARD ========== */
.construction-card {
    background: var(--blanc);
    border-radius: 20px;
    padding: 4rem 3rem;
    box-shadow: var(--ombre-legere);
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
    border: 2px dashed var(--gris-moyen);
}

.construction-icon {
    font-size: 5rem;
    margin-bottom: 1.5rem;
}

.construction-card h2 {
    font-size: 2rem;
    color: var(--bleu-canard);
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.construction-card > p {
    font-size: 1.1rem;
    color: var(--gris-fonce);
    margin-bottom: 2rem;
}

.construction-list {
    text-align: left;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    list-style: none;
    padding: 0;
}

.construction-list li {
    padding: 0.8rem 0;
    font-size: 1.05rem;
    color: var(--gris-fonce);
    border-bottom: 1px solid var(--gris-clair);
}

.construction-list li:last-child {
    border-bottom: none;
}

.construction-card .btn {
    margin-top: 1rem;
}

/* ========== RESPONSIVE MODULES ========== */
@media (max-width: 768px) {
    .module-container {
        padding: 2rem 1rem;
    }
    
    .module-header h1 {
        font-size: 1.8rem;
    }
    
    .construction-card {
        padding: 3rem 2rem;
    }
    
    .construction-icon {
        font-size: 4rem;
    }
    
    .construction-card h2 {
        font-size: 1.6rem;
    }
    
    .construction-list {
        font-size: 0.95rem;
    }
}

/* ========== FLASH MESSAGES ========== */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.alert-success {
    background: #d1fae5;
    border: 1px solid #6ee7b7;
    color: #065f46;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* ========== BADGES ========== */
.badge-admin {
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-light));
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-left: 0.5rem;
}

.badge-you {
    background: var(--gris-clair);
    color: var(--gris-fonce);
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.badge-role {
    padding: 0.3rem 0.8rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-role.admin {
    background: linear-gradient(135deg, var(--bordeaux), var(--bordeaux-light));
    color: white;
}

.badge-role.user {
    background: var(--gris-clair);
    color: var(--gris-fonce);
}

/* ========== TOAST NOTIFICATIONS ========== */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 13px 20px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    opacity: 0;
    transform: translateX(40px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    max-width: 340px;
    pointer-events: auto;
}

.toast.show        { opacity: 1; transform: translateX(0); }
.toast-success     { background: #f0fdf4; border-left: 4px solid #22c55e; color: #14532d; }
.toast-error       { background: #fef2f2; border-left: 4px solid #ef4444; color: #7f1d1d; }
.toast-warning     { background: #fffbeb; border-left: 4px solid #f59e0b; color: #78350f; }
.toast-info        { background: #eff6ff; border-left: 4px solid #3b82f6; color: #1e3a8a; }
/* ========== ADMIN CONTAINER ========== */
.admin-container {
    max-width: var(--page-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: var(--page-padding-top);
}

.admin-header {
    text-align: center;
    margin-bottom: 3rem;
}

.admin-header h1 {
    font-size: 2.5rem;
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.admin-subtitle {
    font-size: 1.2rem;
    color: var(--gris-moyen);
}

/* ========== SECTION CRÉATION UTILISATEUR ========== */
.create-user-section {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--ombre-legere);
}

.create-user-section h2 {
    color: var(--bleu-canard);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.create-user-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.create-user-form .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gris-fonce);
    font-weight: 600;
    font-size: 0.95rem;
}

.create-user-form .form-group input,
.create-user-form .form-group select {
    width: 100%;
    padding: 0.9rem 1.2rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
    background: var(--gris-clair);
}

.create-user-form .form-group input:focus,
.create-user-form .form-group select:focus {
    outline: none;
    border-color: var(--bleu-canard);
    background: var(--blanc);
    box-shadow: 0 0 0 3px rgba(0, 86, 122, 0.1);
}

/* ========== SECTION LISTE UTILISATEURS ========== */
.users-section {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--ombre-legere);
}

.users-section h2 {
    color: var(--bleu-canard);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.users-table-container {
    overflow-x: auto;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

.users-table thead {
    background: linear-gradient(135deg, var(--bleu-canard), var(--bleu-canard-light));
    color: white;
}

.users-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
}

.users-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--gris-clair);
}

.users-table tbody tr:hover {
    background: var(--gris-clair);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.btn-action {
    padding: 0.4rem 0.8rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-edit {
    background: #dbeafe;
    color: #1e40af;
}

.btn-edit:hover {
    background: #93c5fd;
}

.btn-delete {
    background: #fee2e2;
    color: #991b1b;
}

.btn-delete:hover {
    background: #fca5a5;
}

.role-select {
    padding: 0.4rem 0.6rem;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}

/* ========== MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: var(--blanc);
    margin: 10% auto;
    padding: 2.5rem;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: var(--ombre-forte);
}

.modal-content h2 {
    color: var(--bleu-canard);
    margin-bottom: 1rem;
}

.close {
    color: var(--gris-moyen);
    float: right;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.close:hover {
    color: var(--bordeaux);
}

/* ========== CREDENTIALS MODAL (one-shot) ========== */
.credentials-modal .modal-content {
    max-width: 640px;
}

.credentials-warning {
    background: #fff7ed;
    border-left: 4px solid #f59e0b;
    color: #78350f;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin: 0.5rem 0 1.25rem;
    font-size: 0.92rem;
}

.credentials-block {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.8;
}

.credentials-block code {
    background: #fff;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    border: 1px solid #cbd5e1;
    font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
    font-size: 0.95rem;
}

.credentials-textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    font-family: inherit;
    font-size: 0.92rem;
    line-height: 1.5;
    resize: vertical;
    margin: 0.4rem 0 1rem;
    box-sizing: border-box;
}

.credentials-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.form-hint {
    color: var(--gris-moyen, #64748b);
    font-size: 0.9rem;
    margin: -0.25rem 0 1rem;
}

/* ========== RESPONSIVE ADMIN ========== */
@media (max-width: 768px) {
    .create-user-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .users-table {
        font-size: 0.85rem;
    }
    
    .users-table th,
    .users-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .action-buttons {
        flex-direction: column;
        gap: 0.3rem;
    }
}

/* ========== MODULE CCTP - UPLOAD ========== */
.cctp-status {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 3rem;
    box-shadow: var(--ombre-legere);
    display: flex;
    gap: 2rem;
    align-items: center;
}

.cctp-status.success {
    border-left: 5px solid #10b981;
}

.cctp-status.warning {
    border-left: 5px solid #f59e0b;
}

.status-icon {
    font-size: 4rem;
}

.status-content h3 {
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.status-content p {
    color: var(--gris-moyen);
    margin-bottom: 1rem;
}

.upload-section {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--ombre-legere);
}

.upload-section h2 {
    color: var(--bleu-canard);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.upload-instructions {
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.upload-instructions h3 {
    color: var(--bleu-canard);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.upload-instructions ul {
    margin-left: 1.5rem;
    color: var(--gris-fonce);
    line-height: 1.8;
}

.file-upload-area {
    border: 3px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem;
    text-align: center;
    background: var(--gris-clair);
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
    position: relative;
}

.file-upload-area:hover {
    border-color: var(--bleu-canard);
    background: rgba(0, 86, 122, 0.05);
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    cursor: pointer;
}

.upload-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.upload-text {
    font-size: 1.1rem;
    color: var(--gris-fonce);
    margin-bottom: 0.5rem;
}

.file-name {
    font-size: 0.95rem;
    color: var(--gris-moyen);
    margin-top: 1rem;
}

.btn-upload {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
}

/* ========== MODULE CCTP - INTERFACE ========== */
.cctp-generator-container {
    max-width: var(--page-max-width);
    width: 100%;
    margin: 0 auto;
    padding: 3rem 2rem;
    padding-top: var(--page-padding-top);
}

.cctp-header {
    text-align: center;
    margin-bottom: 3rem;
}

.cctp-header h1 {
    font-size: 2.5rem;
    color: var(--bleu-canard);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.cctp-subtitle {
    font-size: 1.2rem;
    color: var(--gris-moyen);
}

.cctp-workspace {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

/* Panneau de sélection */
.selection-panel {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--ombre-legere);
    max-height: 800px;
    overflow-y: auto;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gris-clair);
}

.panel-header h2 {
    color: var(--bleu-canard);
    font-size: 1.5rem;
}

.selection-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    padding: 0.5rem 1rem;
    background: var(--gris-clair);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--gris-fonce);
    transition: all 0.3s ease;
}

.btn-action:hover {
    background: var(--bleu-canard);
    color: white;
}

/* Arborescence */
.tree-view {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.tree-chapter {
    border: 2px solid var(--gris-clair);
    border-radius: 12px;
    overflow: hidden;
}

.chapter-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    cursor: pointer;
}

.chapter-checkbox {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.chapter-label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.chapter-title {
    font-weight: 700;
    color: var(--bleu-canard);
    font-size: 1.1rem;
    outline: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.chapter-title:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--bordeaux);
}

.article-count {
    font-size: 0.85rem;
    color: var(--gris-moyen);
}

.toggle-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--bleu-canard);
    transition: transform 0.3s ease;
}

.articles-list {
    background: var(--blanc);
    padding: 0.5rem;
}

.tree-article {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    margin: 0.3rem 0;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.tree-article:hover {
    background: var(--gris-clair);
}

.article-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.article-label {
    flex: 1;
    cursor: pointer;
}

.article-title {
    color: var(--gris-fonce);
    outline: none;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.article-title:focus {
    background: white;
    box-shadow: 0 0 0 2px var(--bordeaux);
}

/* Panneau de résumé */
.summary-panel {
    background: var(--blanc);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--ombre-legere);
    position: sticky;
    top: 100px;
    height: fit-content;
}

.selection-summary {
    min-height: 200px;
    margin-bottom: 2rem;
}

.empty-message {
    text-align: center;
    color: var(--gris-moyen);
    padding: 3rem 1rem;
    font-style: italic;
}

.summary-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.summary-item {
    padding: 1rem;
    background: var(--gris-clair);
    border-radius: 8px;
    color: var(--gris-fonce);
}

.summary-total {
    padding: 1rem;
    background: linear-gradient(135deg, var(--bleu-canard), var(--bleu-canard-light));
    color: white;
    border-radius: 8px;
    font-size: 1.1rem;
}

.generate-section {
    text-align: center;
}

.btn-generate {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-generate:disabled {
    background: var(--gris-moyen);
    cursor: not-allowed;
    opacity: 0.5;
}

.generate-info {
    font-size: 0.85rem;
    color: var(--gris-moyen);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    color: white;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== RESPONSIVE CCTP ========== */
@media (max-width: 1200px) {
    .cctp-workspace {
        grid-template-columns: 1fr;
    }
    
    .summary-panel {
        position: static;
    }
}

@media (max-width: 768px) {
    .cctp-generator-container {
        padding: 2rem 1rem;
        padding-top: 100px;
    }
    
    .selection-actions {
        flex-direction: column;
    }
    
    .chapter-header {
        flex-wrap: wrap;
    }
}

/* ========== NAVBAR DROPDOWN ========== */

.nav-dropdown {
    position: relative;
}

.nav-dropdown-btn {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.dropdown-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
    display: inline-block;
}

.nav-dropdown.open .dropdown-arrow {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--blanc);
    border-radius: 14px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 260px;
    padding: 0.5rem;
    z-index: 2000;
    border: 1px solid rgba(0,0,0,0.06);
    animation: dropdownFadeIn 0.15s ease-out;
}

.nav-dropdown.open .nav-dropdown-menu {
    display: block;
}

@keyframes dropdownFadeIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    text-decoration: none;
    color: var(--gris-fonce);
    transition: background 0.15s ease;
}

.dropdown-item:hover {
    background: var(--gris-clair);
}

.dropdown-item--soon {
    opacity: 0.6;
    cursor: default;
    pointer-events: none;
}

.dropdown-icon {
    display: none;
}

.dropdown-label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--gris-fonce);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dropdown-desc {
    font-size: 0.78rem;
    color: var(--gris-moyen);
    margin-top: 0.1rem;
}

.dropdown-divider {
    height: 1px;
    background: var(--gris-clair);
    margin: 0.4rem 0.5rem;
}

.soon-badge {
    background: #fef3c7;
    color: #92400e;
    font-size: 0.68rem;
    padding: 0.1rem 0.45rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.nav-link--admin {
    color: var(--bordeaux) !important;
}


.summary-chapter { color: var(--bordeaux); }
.summary-article { padding-left: 0.5rem; color: var(--gris-fonce); }
.summary-sub { padding-left: 1.2rem; font-size: 0.85rem; color: var(--gris-moyen); }
.summary-badge {
    background: var(--bordeaux);
    color: white;
    font-size: 0.7rem;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.4rem;
    font-weight: 600;
}
/* ========== DEMANDES — notification admin dashboard ========== */
.dem-admin-alert {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #FFFBEB;
    border: 1px solid #F59E0B;
    border-radius: 10px;
    padding: 0.85rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    color: #78350F;
}
.dem-admin-alert a {
    margin-left: auto;
    color: #D97706;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}
.dem-admin-alert a:hover { text-decoration: underline; }

/* ========== TAGS & FAVORIS ========== */
.tw-row-hidden { display: none !important; }

/* Widget conteneur */
.tw { display: inline-flex; align-items: center; gap: 0.35rem; flex-wrap: wrap; }

/* Étoile favori */
.tw-star {
    background: none; border: none; cursor: pointer; font-size: 1.05rem;
    color: #CBD5E0; transition: color 0.15s, transform 0.1s; padding: 0; line-height: 1;
}
.tw-star:hover      { color: #F59E0B; transform: scale(1.2); }
.tw-star.tw-star-on { color: #F59E0B; }

/* Chips de tags */
.tw-chips { display: inline-flex; align-items: center; gap: 0.3rem; flex-wrap: wrap; }
.tw-chip  {
    display: inline-flex; align-items: center; gap: 0.2rem;
    padding: 0.15rem 0.55rem; border-radius: 20px;
    background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE;
    font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.tw-chip-rm {
    background: none; border: none; cursor: pointer; color: #93C5FD;
    font-size: 0.9rem; line-height: 1; padding: 0; margin-left: 2px;
    transition: color 0.15s;
}
.tw-chip-rm:hover { color: #EF4444; }

/* Bouton + tag */
.tw-add-btn {
    background: none; border: 1.5px dashed #CBD5E0; border-radius: 20px;
    cursor: pointer; color: #94A3B8; font-size: 0.78rem; padding: 0.1rem 0.5rem;
    transition: border-color 0.15s, color 0.15s;
}
.tw-add-btn:hover { border-color: #3B82F6; color: #3B82F6; }

/* Zone de saisie inline */
.tw-input-wrap { display: inline-flex; align-items: center; gap: 0.2rem; }
.tw-input {
    width: 100px; padding: 0.2rem 0.5rem; border: 1.5px solid #CBD5E0;
    border-radius: 6px; font-size: 0.75rem; font-family: inherit;
    outline: none; background: #fff;
}
.tw-input:focus { border-color: #3B82F6; }
.tw-ok, .tw-cancel {
    background: none; border: none; cursor: pointer; font-size: 0.85rem;
    padding: 0 0.15rem; line-height: 1;
}
.tw-ok     { color: #22C55E; }
.tw-cancel { color: #EF4444; }

/* Barre de filtres tags */
.tw-filter-bar {
    display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
    padding: 0.55rem 0.75rem; background: #F8FAFC; border: 1px solid #E2E8F0;
    border-radius: 8px; margin-bottom: 0.75rem; font-size: 0.82rem;
}
.tw-filter-bar label { color: #64748B; font-weight: 500; white-space: nowrap; }
.tw-fav-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.3rem 0.85rem; border-radius: 20px; border: 1.5px solid #E2E8F0;
    background: #fff; color: #64748B; font-size: 0.82rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.tw-fav-btn:hover         { border-color: #F59E0B; color: #D97706; }
.tw-fav-btn.tw-filter-active { background: #FEF3C7; border-color: #F59E0B; color: #D97706; }
.tw-tag-input {
    padding: 0.3rem 0.75rem; border: 1.5px solid #E2E8F0; border-radius: 20px;
    font-size: 0.82rem; font-family: inherit; outline: none; background: #fff; width: 160px;
    transition: border-color 0.15s;
}
.tw-tag-input:focus             { border-color: #3B82F6; }
.tw-tag-input.tw-filter-active  { border-color: #3B82F6; background: #EFF6FF; }
.tw-reset-btn {
    background: none; border: none; cursor: pointer; color: #94A3B8;
    font-size: 0.8rem; padding: 0 0.3rem;
}
.tw-reset-btn:hover { color: #EF4444; }
.tw-visible-count { color: #94A3B8; font-size: 0.8rem; margin-left: auto; }

/* Colonne tags dans le tableau */
.th-tags { min-width: 160px; font-size: 0.75rem; }
.td-tags  { white-space: normal; }

/* ── Largeur tables historique après ajout colonne Tags ── */
.history-container  { max-width: min(1900px, calc(100vw - 3rem)) !important; }
.history-table      { min-width: 1380px !important; }
.th-tags, .td-tags  { min-width: 120px; max-width: 220px; }

/* Widget tags plus compact dans les tableaux */
.tw-chip   { font-size: 0.68rem; padding: 0.1rem 0.45rem; }
.tw-input  { width: 85px; font-size: 0.72rem; }
.tw-add-btn { font-size: 0.72rem; padding: 0.08rem 0.4rem; }
.tw-star-placeholder { display: inline-block; width: 1.2rem; }
