:root {
    /* Premium Color Palette */
    --primary-hue: 250;
    /* Deep Purple/Blue */
    --primary: hsl(var(--primary-hue), 80%, 60%);
    --primary-dark: hsl(var(--primary-hue), 80%, 50%);
    --primary-light: hsl(var(--primary-hue), 80%, 96%);

    --primary-font: 'Outfit';

    --text-main: hsl(220, 20%, 20%);
    --text-muted: hsl(220, 10%, 50%);
    --text-light: hsl(0, 0%, 100%);
    --gpec-purple: #6366f1;

    --bg-page: hsl(220, 30%, 98%);
    --white: #ffffff;

    --success: hsl(150, 60%, 45%);
    --error: hsl(0, 70%, 55%);

    /* Shared Table Styles (from mes-modeles) */
    .status-badge-created,
    .status-badge-active {
        background-color: rgba(16, 185, 129, 0.1);
        color: #10b981;
        border: 1px solid #10b981;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        text-align: center;
        min-width: 80px;
    }

    .status-badge-draft {
        background-color: #f1f5f9;
        color: #64748b;
        border: 1px solid #cbd5e0;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        text-align: center;
        min-width: 80px;
    }

    .status-badge-upcoming {
        background-color: #e0e7ff;
        color: #4f46e5;
        border: 1px solid #c7d2fe;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        text-align: center;
        min-width: 80px;
    }

    .status-badge-finished {
        background-color: #f1f5f9;
        color: #475569;
        border: 1px solid #94a3b8;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.8rem;
        font-weight: 600;
        text-transform: uppercase;
        display: inline-block;
        text-align: center;
        min-width: 80px;
    }

    .campaign-badge {
        background-color: #4f46e5;
        color: white;
        padding: 4px 12px;
        border-radius: 4px;
        font-size: 0.85rem;
        display: inline-block;
        white-space: normal;
        /* Allow wrapping */
        max-width: 100%;
        /* Ensure it doesn't overflow parent */
        line-height: 1.4;
    }

    .text-muted {
        color: #64748b;
    }

    .action-cell {
        position: relative;
    }

    .btn-icon-table {
        background: none;
        border: none;
        color: #94a3b8;
        cursor: pointer;
        font-size: 1.2rem;
        padding: 4px 8px;
        border-radius: 4px;
        transition: var(--transition);
    }

    .btn-icon-table:hover {
        background-color: #f1f5f9;
        color: #64748b;
    }

    --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.05),
    0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.05),
    0 4px 6px -2px rgba(0, 0, 0, 0.025);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05),
    0 10px 10px -5px rgba(0, 0, 0, 0.02);

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Styles pour les pages de Référentiels (Départements, Services, Filiales, Fonctions) --- */

/* Menu Actions Dropdown */
.action-cell {
    position: relative;
    text-align: center;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    z-index: 100;
    min-width: 180px;
    margin-top: 0.5rem;
    padding: 0.5rem;
    animation: fadeInDropdown 0.2s ease-out;
}

.dropdown-menu.dropup {
    top: auto;
    bottom: 100%;
    margin-top: 0;
    margin-bottom: 0.5rem;
    animation: fadeInDropup 0.2s ease-out;
}

.dropdown-menu.active {
    display: block;
}

.nav-item.sub-item {
    padding-left: 3rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.nav-item.sub-item.sub-sub-item {
    padding-left: 4.5rem;
    font-size: 0.85rem;
}

.nav-item.sub-item:hover {
    color: var(--white);
    background: transparent;
}

.dropdown-item {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: #475569;
    cursor: pointer;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.2s;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #4f46e5;
}

.dropdown-item i {
    font-size: 0.85rem;
    color: #94a3b8;
}

@keyframes fadeInDropdown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDropup {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Pagination Styles */
.pagination-container {
    margin-top: auto;
    /* Push to bottom of flex card */
    border-top: 1px solid #edf2f7;
    padding-top: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #64748b;
}

.items-per-page select {
    padding: 0.4rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #1e293b;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pagination-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-controls .page-btn {
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    background: white;
    color: #64748b;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 36px;
}

.pagination-controls .page-btn:hover:not(.disabled) {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #1e293b;
}

.pagination-controls .page-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.pagination-controls .page-btn.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination-info {
    font-size: 0.9rem;
    color: #64748b;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 3000;
    /* Increased to stay on top */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-card {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.active .modal-card {
    transform: translateY(0);
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2.5rem;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: hsl(var(--primary-hue), 80%, 85%);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--primary-font), sans-serif;
}

body {
    background-color: var(--bg-page);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    background: var(--white);
    overflow: hidden;
}

/* Brand Section - Left Side */
.brand-section {
    flex: 1;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    overflow: hidden;
    padding: 2rem;
}

.brand-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('https://images.unsplash.com/photo-1497215728101-856f4ea42174?ixlib=rb-1.2.1&auto=format&fit=crop&w=1950&q=80') center/cover no-repeat;
    opacity: 0.1;
    mix-blend-mode: overlay;
}

.brand-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 400px;
    animation: fadeIn 1s ease-out;
}

.logo-circle {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
}

.brand-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.brand-content p {
    font-size: 1.1rem;
    opacity: 0.9;
    line-height: 1.6;
    font-weight: 300;
}

/* Login Section - Right Side */
.login-section {
    flex: 1.5;
    /* Give more space to the form */
    max-width: 750px;
    /* Increased from 600px */
    width: 100%;
    display: flex;
    align-items: flex-start;
    /* Aligné vers le haut */
    justify-content: center;
    padding: 2rem 3rem;
    /* Réduit un peu le padding haut pour coller au top */
    background: var(--white);
    position: relative;
    overflow-y: auto;
    /* Permet le scroll si le formulaire est long */
}

/* Adjust flex on larger screens so white part isn't too wide if screen is huge */
@media (min-width: 1200px) {
    .login-section {
        flex: 0 0 650px;
        /* Increased from 500px */
    }

    .brand-section {
        flex: 0.8;
        /* Reduce the illustration panel */
    }
}

.login-container {
    width: 100%;
    max-width: 550px;
    /* Increased from 400px to accommodate 4 tabs */
    animation: slideUp 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.login-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.login-header h2 {
    font-size: 1.6rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Styles */
.input-group {
    margin-bottom: 0.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
}

input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    background: #f8fafc;
    transition: var(--transition);
    outline: none;
}

input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

input:focus+.input-icon,
input:not(:placeholder-shown)+.input-icon {
    color: var(--primary);
}

.input-border {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
    border-radius: 0 0 12px 12px;
}

input:focus~.input-border {
    width: 100%;
}

/* Password input with toggle button */
input[type="password"],
input[type="text"]#password {
    padding-right: 3rem;
    /* Make room for the toggle button */
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 1.1rem;
    transition: var(--transition);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.toggle-password:hover {
    color: var(--primary);
    transform: translateY(-50%) scale(1.1);
}

.toggle-password:active {
    transform: translateY(-50%) scale(0.95);
}

.forgot-password {
    text-align: right;
    margin-top: 0.5rem;
}

.forgot-password a {
    color: var(--primary);
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.forgot-password a:hover {
    text-decoration: underline;
    color: var(--primary-dark);
}

.btn-login {
    width: 100%;
    padding: 0.75rem;
    border: none;
    background: var(--primary);
    color: var(--white);
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    box-shadow: 0 4px 12px rgba(var(--primary-hue), 80%, 60%, 0.3);
}

.btn-login:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(var(--primary-hue), 80%, 60%, 0.4);
}

.btn-login:active {
    transform: translateY(0);
}

/* Button Group - For side-by-side buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.button-group .btn-login {
    flex: 1;
    margin-top: 0;
}

/* Secondary Button Style */
.btn-login.btn-secondary {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    box-shadow: none;
}

.btn-login.btn-secondary:hover {
    background: var(--primary-light);
    border-color: var(--primary-dark);
    color: var(--primary-dark);
    box-shadow: none;
    transform: translateY(-2px);
}

.btn-login.btn-secondary:active {
    transform: translateY(0);
}

.register-link {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.register-link a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    margin-left: 0.2rem;
    transition: var(--transition);
}

.register-link a:hover {
    color: var(--primary-dark);
}

/* Loaders & States */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

.btn-login.loading span,
.btn-login.loading i {
    display: none;
}

.btn-login.loading .loader {
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsiveness */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .brand-section {
        flex: 0 0 35%;
        /* Takes top part */
        padding: 1.5rem;
    }

    .logo-circle {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }

    .brand-content h1 {
        font-size: 1.6rem;
    }

    .login-section {
        flex: 1;
        padding: 2rem;
        max-width: none;
        align-items: flex-start;
        /* Align to top on mobile for better keyboard experience */
        overflow-y: auto;
    }

    .login-container {
        margin-top: 1rem;
        max-width: none;
    }
}

/* =========================================
   DASHBOARD STYLES
   ========================================= */

.dashboard-body {
    background-color: #f3f4f6;
    min-height: 100vh;
    display: block;
    overflow-x: hidden;
}

.dashboard-container {
    display: flex;
    min-height: 100vh;
    width: 100%;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    z-index: 200;
    flex-shrink: 0;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar.collapsed {
    width: 76px;
    overflow-x: hidden;
}

.sidebar.collapsed .brand-title,
.sidebar.collapsed .version-label,
.sidebar.collapsed .sidebar-logo-ent,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .nav-item .ml-auto,
.sidebar.collapsed .user-display span,
.sidebar.collapsed .btn-logout-sidebar span {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    white-space: nowrap;
}

.sidebar.collapsed .sidebar-brand-container {
    justify-content: center;
}

.sidebar.collapsed .user-display {
    justify-content: center;
    padding: 0.75rem 0;
}

.sidebar.collapsed .btn-logout-sidebar {
    padding: 0.6rem;
    text-align: center;
}

.sidebar.collapsed .nav-item i:not(.ml-auto) {
    margin-right: 0;
    width: 100%;
    text-align: center;
    font-size: 1.2rem;
}

.sidebar-header {
    height: 70px;
    padding: 0 1rem;
    display: flex;
    align-items: center;
}

/* Sidebar Redesign - 3 Column Layout */
.sidebar-brand-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.sidebar-logo-gpec,
.sidebar-logo-ent {
    height: 38px;
    width: 38px;
    object-fit: contain;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
}

.sidebar-logo-gpec:hover,
.sidebar-logo-ent:hover {
    transform: scale(1.05);
    background: white;
}

.sidebar-brand-meta {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    color: var(--white);
    text-decoration: none;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.02em;
}

.version-label {
    font-size: 0.65rem;
    opacity: 0.7;
    margin-top: 2px;
    font-weight: 400;
}

.logo {
    display: flex;
    align-items: center;
    width: 100%;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
    /* Added margin to move footer up and give air */
}

/* Ligne de séparation creusée entre les groupes de menu (niveau 1) */
.sidebar-nav > *:not(:last-child) {
    position: relative;
}

.sidebar-nav > *:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: -0.25rem;
    left: 1rem;
    right: 1rem;
    height: 1px;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 0.35rem 1.25rem;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.95rem;
    position: relative;
    transition: var(--transition);
}

.nav-item:hover,
.nav-item.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.1);
}

.nav-item i:not(.ml-auto) {
    width: 20px;
    margin-right: 12px;
    text-align: center;
    font-size: 0.85rem;
    opacity: 0.8;
}

.nav-item.active i:not(.ml-auto) {
    opacity: 1;
}

.nav-item.active::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: var(--white);
    border-radius: 4px 0 0 4px;
}

.ml-auto {
    margin-left: auto;
    font-size: 0.8rem;
}

/* Sidebar Submenus */
.nav-group-items {
    display: flex;
    flex-direction: column;
    /* gap: 0.2rem; */
}

.nav-group.collapsed .nav-group-items {
    display: none;
}

.nav-group-toggle .fa-chevron-up {
    transition: transform 0.3s ease;
}

.nav-group.collapsed .nav-group-toggle .fa-chevron-up {
    transform: rotate(180deg);
}

.nav-item.sub-item {
    padding-left: 3rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.nav-item.sub-item.sub-sub-item {
    padding-left: 4.5rem;
    font-size: 0.85rem;
}

.nav-item.sub-item:hover {
    color: var(--white);
    background: transparent;
}

.sidebar-footer {
    padding: 1.5rem;
}

.btn-logout-sidebar {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 0.6rem 1rem;
    border-radius: 6px;
    width: 100%;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
}

.btn-logout-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
}

.user-display {
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 0.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--white);
    flex-wrap: nowrap;
    white-space: nowrap;
}

.user-display i {
    font-size: 0.85rem;
    opacity: 0.8;
}

#userNameDisplay {
    font-size: 0.85rem;
    font-weight: 500;
    flex: 1;
}

/* Bouton de changement de mot de passe */
.btn-change-password {
    background: transparent;
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    opacity: 0.8;
}

.btn-change-password:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 1;
    transform: scale(1.05);
}

.btn-change-password:active {
    transform: scale(0.95);
}

/* Modal de changement de mot de passe */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-overlay.show {
    display: flex;
}

.modal-container {
    background: var(--white);
    border-radius: 16px;
    width: 90%;
    max-width: 480px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-main);
}

.modal-close {
    background: #f8fafc;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: #64748b;
    transition: var(--transition);
}

.modal-close:hover {
    background: #fee2e2;
    color: #ef4444;
}

.modal-body {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.password-input-wrapper {
    position: relative;
}

.password-input-wrapper input {
    width: 100%;
    padding: 0.875rem 3rem 0.875rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    color: var(--text-main);
    background: #f8fafc;
    transition: var(--transition);
    outline: none;
}

.password-input-wrapper input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.password-input-wrapper .toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.85rem;
    transition: var(--transition);
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-input-wrapper .toggle-password:hover {
    color: var(--primary);
}

.form-hint {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.error-message {
    background: #fee2e2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 8px;
    font-size: 0.875rem;
    margin-top: 1rem;
    border: 1px solid #fca5a5;
}

.modal-footer {
    padding: 1.25rem 1.5rem;
    border-top: 1px solid #f1f5f9;
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.btn-secondary {
    background: #f1f5f9;
    color: #475569;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-secondary:hover {
    background: #e2e8f0;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(var(--primary-hue), 80%, 60%, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(var(--primary-hue), 80%, 60%, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    /* Contains the scrollable dashboard-grid */
    position: relative;
}

/* Topbar */
.topbar {
    height: 70px;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: var(--shadow-sm);
    z-index: 10;
}

.page-title {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 600;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.btn-primary-small {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.btn-primary-small:hover {
    background: var(--primary-dark);
}

.user-avatar img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-light);
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: var(--primary-light);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--primary);
    color: var(--white);
}

.lang-selector-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.lang-selector-select {
    appearance: none;
    background: transparent;
    border: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding-right: 1.2rem;
    /* Space for arrow */
    font-family: inherit;
}

.lang-selector-select:focus {
    outline: none;
    color: var(--primary);
}

.lang-arrow {
    position: absolute;
    right: 0;
    pointer-events: none;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.lang-selector-wrapper:hover .lang-selector-select,
.lang-selector-wrapper:hover .lang-arrow {
    color: var(--primary);
}

/* Grid Layout */
/* Grid Layout */
.dashboard-grid {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    max-width: 1600px;
    margin: 0 auto;
    width: 100%;
}

.center-col,
.right-col {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 1600px;
    flex: 1;
    /* Stretch vertically */
}

/* Cards & Sections */
.section-header h3 {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.card {
    background: var(--white);
    border-radius: 8px;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    flex: 1;
    /* Stretch to fill parent height if in flex container */
}

/* Specific card class for lists with dropdowns/menus */
.card-table {
    overflow: visible !important;
    padding-bottom: 5rem;
    /* Ensure last row menu is visible */
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 120px);
}

/* Dashboard Section Titles */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-muted);
    /* Attenuated color */
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--primary);
    /* Keep icon colorful for contrast */
}

/* Discovery Card */
.discovery-card {
    background: #fdfdfd;
}

.card-header-text h3 {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-main);
}

.discovery-content {
    display: flex;
    gap: 1rem;
    background: #f3f0ff;
    /* Very light purple */
    border-radius: 8px;
    overflow: hidden;
}

.discovery-text {
    padding: 1.5rem;
    flex: 1;
}

.discovery-text h4 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.discovery-text p {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.discovery-image {
    width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.5);
    flex-shrink: 0;
}

/* Stats Layout Reorganization */
.stats-effectif-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    width: 100%;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 0.75rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.stats-effectif-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    width: 100%;
}

.stat-card-main {
    flex: 2;
    min-height: 180px;
    padding: 2rem !important;
    display: flex;
    flex-direction: column !important;
    align-items: flex-start !important;
}

.stat-main-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    width: 100%;
}

.stat-gender-info {
    display: flex;
    gap: 2rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.gender-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.gender-item i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.gender-item span {
    font-size: 1.4rem;
    font-weight: 700;
}

.gender-item small {
    font-size: 0.8rem;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-mini {
    flex: 1;
    padding: 0.75rem 1.25rem !important;
    display: flex;
    flex-direction: row !important;
    align-items: center !important;
    gap: 1.25rem !important;
}

.stat-card-chart {
    flex: 1.5;
    min-width: 320px;
    background: white;
    border-radius: 20px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    transition: var(--transition);
}

.stat-card-chart:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.stat-icon-top {
    font-size: 1.6rem;
    margin-bottom: 0.25rem;
    opacity: 0.9;
}

.stat-number {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    font-weight: 500;
    opacity: 0.85;
}

/* Color Variants */
.stat-card.blue, .stat-card.indigo, .stat-card.pink, .stat-card.purple, .stat-card.teal, .stat-card.orange {
    color: white;
}

.stat-card.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.stat-card.indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
}

.stat-card.pink {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%);
}

.stat-card.purple {
    background: linear-gradient(135deg, #a855f7 0%, #9333ea 100%);
}

.stat-card.teal {
    background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
}

.stat-card.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Promo Card */
.promo-card {
    background: #ff7675;
    /* Salmon/Red */
    color: var(--white);
}

.promo-card h3,
.promo-card p {
    position: relative;
    z-index: 2;
}

.promo-card h3 {
    margin-bottom: 0.5rem;
}

.promo-card p {
    font-size: 0.95rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.btn-white {
    background: var(--white);
    color: #ff7675;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    z-index: 2;
}

.promo-img {
    position: absolute;
    bottom: -10px;
    right: 10px;
    font-size: 5rem;
    opacity: 0.2;
    z-index: 1;
}

/* Academy & Blog Cards */
.academy-card h3,
.blog-card h3 {
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.academy-card p {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
    padding-right: 2rem;
}

.btn-outline-primary {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--white);
}

.academy-img {
    position: absolute;
    right: 1rem;
    bottom: 1rem;
    font-size: 3rem;
    color: #ffeaa7;
    opacity: 0.5;
}

.blog-item {
    margin-bottom: 0.75rem;
}

.blog-item h4 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #dfe6e9;
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
}

.date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-left: 0.5rem;
}

/* Library Card */
.library-card .library-content {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.library-content p {
    font-size: 0.9rem;
    color: var(--text-main);
    flex: 1;
    margin-right: 1rem;
}

.library-illustration {
    font-size: 1.6rem;
    color: #64b5f6;
}

/* Mobile Menu Button */
.mobile-menu-btn {
    display: block;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: var(--text-main);
    cursor: pointer;
    margin-right: 1rem;
    transition: var(--transition);
}

.mobile-menu-btn:hover {
    color: var(--primary);
}

/* Responsive Dashboard */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-container {
        flex-direction: column;
        overflow-y: auto;
    }

    .mobile-menu-btn {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        z-index: 99999;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        padding: 1.5rem 0;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar-header {
        padding: 0 1.5rem 2rem;
        display: block;
        width: 100%;
    }

    .sidebar-nav,
    .sidebar-footer {
        display: flex;
        /* Force display flex on mobile */
    }

    .main-content {
        height: auto;
        overflow: visible;
        width: 100%;
    }

    .dashboard-grid {
        padding: 0.75rem;
    }

    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 900;
        display: none;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

/* Personnel List Styles */
/* Personnel & Campaign List Styles */
.personnel-container,
.campaign-container {
    background: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-height: calc(100vh - 120px);
}

.personnel-actions,
.campaign-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    gap: 1.5rem;
    flex-wrap: wrap;
    border-bottom: 1px solid #edf2f7;
}

.search-wrapper,
.campaign-search-wrapper {
    position: relative;
    flex: 1;
    max-width: 300px;
    /* Réduit pour laisser de la place au CSV */
}

.search-wrapper i.fa-magnifying-glass,
.campaign-search-wrapper i.fa-magnifying-glass {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.clear-search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    cursor: pointer;
    display: none;
    transition: var(--transition);
}

.clear-search-icon:hover {
    color: var(--primary);
}

.search-wrapper input,
.campaign-search-wrapper input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    background: #f8fafc;
    transition: var(--transition);
}

.search-wrapper input:focus,
.campaign-search-wrapper input:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.sort-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
}

.sort-label {
    color: var(--text-muted);
}

.actions-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.btn-secondary-csv {
    background: var(--white);
    color: var(--text-main);
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    transition: var(--transition);
    cursor: pointer;
}

.btn-secondary-csv:hover {
    background: #f8fafc;
    border-color: var(--primary);
    color: var(--primary);
}

/* CSV Info Helper & Tooltip */
.csv-action-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Espace réduit entre le bouton et le "i" */
}

.csv-info-helper {
    position: relative;
    display: flex;
    align-items: center;
}

.csv-info-helper .info-icon {
    color: #94a3b8;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    text-decoration: none;
}

.csv-info-helper .info-icon:hover {
    color: var(--primary);
    transform: scale(1.1);
}

.tooltip-content {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 240px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 12px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 100;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    margin-top: 10px;
}

.csv-info-helper:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.tooltip-content::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid #e2e8f0;
}

.tooltip-content h4 {
    font-size: 0.9rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
    font-weight: 700;
}

.tooltip-content p {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.8rem;
}

.tooltip-download-link {
    display: block;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 600;
    text-align: center;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}

.btn-primary-add {
    background: var(--primary);
    color: var(--white);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.2);
}

.btn-primary-add:hover {
    background: #5b4bc4;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(108, 92, 231, 0.3);
}

.sort-select {
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 500;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    padding: 0.25rem;
}

.sort-select:focus {
    color: var(--primary-dark);
}

/* Personnel Table */
/* Personnel & Campaign Table */
.personnel-table-wrapper,
.campaign-table-wrapper,
.modeles-table-wrapper {
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    flex: 1;
    min-height: 250px; /* Assure que le menu action reste visible avec peu de lignes */
}

.personnel-table,
.campaign-table,
.modeles-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    table-layout: fixed;
}

.personnel-table th,
.campaign-table th,
.modeles-table th {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: black;
    border-bottom: 2px solid #edf2f7;
}

th.sortable {
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    user-select: none;
}

th.sortable:hover {
    color: var(--primary);
    background: #f8fafc;
}

th.sortable i {
    font-size: 0.75rem;
    margin-left: 5px;
    opacity: 0.3;
    transition: var(--transition);
}

th.sortable.active-sort {
    /* Text color remains unchanged */
}

th.sortable.active-sort i {
    opacity: 1;
    color: var(--primary);
}


.personnel-table td,
.campaign-table td,
.modeles-table td {
    padding: 0.2rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    border-bottom: 1px solid #edf2f7;
    vertical-align: middle;
}

.personnel-table tr:last-child td,
.campaign-table tr:last-child td,
.modeles-table tr:last-child td {
    border-bottom: none;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    overflow: hidden;
    font-size: 0.85rem;
}

.personnel-table tr:has(.fa-user-shield) .user-avatar-small {
    background: #334155;
    /* Slate pour Admin */
}

.personnel-table tr:has(.fa-user-tie) .user-avatar-small {
    background: #0984e3;
    /* Blue pour Manager */
}

.user-avatar-small img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-name {
    font-weight: 500;
    color: var(--primary);
}

.email-link {
    color: var(--text-main);
    text-decoration: none;
    border-bottom: 1px solid #cbd5e0;
    transition: var(--transition);
}

.email-link:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.btn-table-action {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-table-action:hover {
    color: var(--primary);
    background: var(--primary-light);
}

.btn-action-dots {
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: #f1f5f9;
    color: #64748b;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.btn-action-dots:hover {
    background: var(--primary-light);
    color: var(--primary);
    transform: scale(1.05);
}

/* Protection des pages */
.protected-content {
    display: none !important;
}

#userNameDisplay {
    color: var(--white);
    font-weight: 500;
    opacity: 0.9;
}

/* Dropdown Menu */
.dropdown-wrapper {
    position: relative;
    display: inline-block;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background: var(--white);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    min-width: 150px;
    z-index: 100;
    display: none;
    flex-direction: column;
    padding: 0.5rem 0;
    margin-top: 0.5rem;
    border: 1px solid #edf2f7;
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    border: none;
    background: none;
    width: 100%;
}

.dropdown-item:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.dropdown-item i {
    font-size: 0.85rem;
    width: 1.25rem;
    text-align: center;
}

.dropdown-item.delete {
    color: #e74c3c;
}

/* Effet visuel lors de la mise à jour du statut */
.dropdown-item.flash-success {
    animation: flash-success 900ms ease;
    border-radius: 6px;
}

@keyframes flash-success {
    0% {
        background-color: rgba(16, 185, 129, 0.22);
        transform: translateY(-3px);
    }

    40% {
        background-color: rgba(16, 185, 129, 0.12);
        transform: translateY(0);
    }

    100% {
        background-color: transparent;
        transform: none;
    }
}

.dropdown-item.flash-error {
    animation: flash-error 900ms ease;
    border-radius: 6px;
}

@keyframes flash-error {
    0% {
        background-color: rgba(231, 76, 60, 0.22);
        transform: translateY(-3px);
    }

    40% {
        background-color: rgba(231, 76, 60, 0.12);
        transform: translateY(0);
    }

    100% {
        background-color: transparent;
        transform: none;
    }
}


.btn-cancel {
    flex: 1;
    background: transparent;
    border: 2px solid #e2e8f0;
    color: var(--text-muted);
    padding: 0.8rem 1rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-cancel:hover {
    background: #f8fafc;
    border-color: #cbd5e0;
    color: var(--text-main);
}

.dropdown-item.delete:hover {
    background: #fff5f5;
    color: #c0392b;
}

/* Modern GPEC Modal */
.gpec-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(8px);
    display: none;
    align-items: flex-start;
    /* Changed from center to allow scrolling */
    justify-content: center;
    z-index: 13000;
    opacity: 0;
    transition: opacity 0.3s ease;
    overflow-y: auto;
    /* Enable scroll on the overlay */
    padding: 2rem 1rem;
}

.gpec-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.gpec-modal {
    background: var(--white);
    width: 90%;
    max-width: 450px;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.gpec-modal-overlay.active .gpec-modal {
    transform: translateY(0);
}

.modal-icon {
    width: 60px;
    height: 60px;
    background: #fff7ed;
    color: #f97316;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
}

.gpec-modal h3 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.gpec-modal p {
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
}

.modal-btn {
    flex: 1;
    padding: 0.8rem 1.5rem;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
}

.modal-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.modal-btn-cancel:hover {
    background: #e2e8f0;
}

.modal-btn-confirm {
    background: #1e293b;
    color: var(--white);
    border: none;
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.modal-btn-confirm:hover {
    background: #0f172a;
    box-shadow: 0 8px 20px rgba(30, 41, 59, 0.3);
}

/* K2000 Scanner Loader */
.loader-spinner {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 6px;
    background: rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: none;
    border-radius: 0 0 8px 8px;
    z-index: 10;
}

.loader-spinner::after {
    content: '';
    position: absolute;
    top: 0;
    left: -50%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, #ff4d4d, #ff0000, #ff4d4d, transparent);
    box-shadow: 0 0 20px #ff0000, 0 0 10px #ff0000, 0 0 30px rgba(255, 0, 0, 0.5);
    animation: k2000-scan 1s infinite ease-in-out;
}

@keyframes k2000-scan {
    0% {
        left: -50%;
    }

    50% {
        left: 100%;
    }

    100% {
        left: -50%;
    }
}

.btn-secondary-csv {
    position: relative;
    overflow: hidden;
}

.btn-loading .loader-spinner {
    display: block;
}

.btn-loading i,
.btn-loading span {
    opacity: 0.5;
}

.page-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    color: var(--text-muted);
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    margin-top: 1rem;
    border-top: 1px solid #edf2f7;
    flex-wrap: wrap;
    gap: 1rem;
}

.items-per-page {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.items-per-page select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    outline: none;
    color: var(--text-main);
    cursor: pointer;
}

.pagination-controls {
    display: flex;
    gap: 0.4rem;
}

.page-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: var(--white);
    color: var(--text-main);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.page-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.page-btn.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
}

.pagination-info {
    font-size: 0.9rem;
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
    }
}

/* Notifications */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.95rem;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 10000;
    max-width: 400px;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-success {
    border-left: 4px solid #10b981;
}

.notification-success i {
    color: #10b981;
    font-size: 1.2rem;
}

.notification-error {
    border-left: 4px solid #ef4444;
}

.notification-error i {
    color: #ef4444;
    font-size: 1.2rem;
}

.notification-info {
    border-left: 4px solid #3b82f6;
}

.notification-info i {
    color: #3b82f6;
    font-size: 1.2rem;
}

/* Loading state for button */
.btn-login.loading {
    pointer-events: none;
    position: relative;
}

.btn-login.loading span,
.btn-login.loading i {
    opacity: 0;
}

.btn-login .loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.btn-login.loading .loader {
    display: block;
}

.input-wrapper select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.85rem;
    color: var(--text-main);
    background: #f8fafc;
    transition: var(--transition);
    outline: none;
    appearance: none;
}

.input-wrapper select:focus {
    background: var(--white);
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* Responsive adjustments for the new stats layout */
@media (max-width: 992px) {
    .stats-effectif-row {
        flex-direction: column;
    }

    .stat-card-main {
        flex: none;
        width: 100%;
        min-height: 140px;
    }

    .stat-gender-stack {
        flex-direction: row;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-gender-stack {
        flex-direction: column;
    }
}


/* Ensure notifications are top-most */
.notification {
    z-index: 10000 !important;
}

/* TABS STYLING - BINDER / CLASSEUR */
.tabs-header {
    display: flex;
    background: transparent;
    padding: 0 1rem;
    margin-bottom: 0;
    gap: 4px;
    width: 100%;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 0.4rem 1rem;
    border: 1px solid transparent;
    border-bottom: none;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.tab-btn.active {
    background: white;
    color: #4f46e5;
    border-color: #e2e8f0;
    border-bottom-color: white;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.02);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #4f46e5;
    border-radius: 12px 12px 0 0;
}

#tabsContentContainer {
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 0;
    min-height: 300px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* --- Evaluation Sheet Styles --- */
.evaluation-sheet {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.sheet-header {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.sheet-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.sheet-header-compact {
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.position-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sheet-header-compact .eval-position {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
}

.behavior-count-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.eval-position {
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
}

.sheet-body {
    padding: 2rem;
}

.competency-block {
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.competency-header {
    background: #f1f5f9;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.competency-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
}

.competency-meta {
    font-size: 0.85rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.behaviors-list {
    padding: 0;
}

.behavior-row {
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .stat-gender-stack {
        flex-direction: column;
    }
}


/* Ensure notifications are top-most */
.notification {
    z-index: 10000 !important;
}

/* TABS STYLING - BINDER / CLASSEUR */
.tabs-header {
    display: flex;
    background: transparent;
    padding: 0 1rem;
    margin-bottom: 0;
    gap: 4px;
    width: 100%;
    flex-wrap: wrap;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 0.4rem 1rem;
    border: 1px solid transparent;
    border-bottom: none;
    background: #e2e8f0;
    color: #64748b;
    font-weight: 500;
    font-size: 0.85rem;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.tab-btn:hover {
    background: #cbd5e1;
    color: #1e293b;
}

.tab-btn.active {
    background: white;
    color: #4f46e5;
    border-color: #e2e8f0;
    border-bottom-color: white;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 -2px 6px rgba(0, 0, 0, 0.02);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: #4f46e5;
    border-radius: 12px 12px 0 0;
}

#tabsContentContainer {
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 0;
    min-height: 300px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

/* --- Evaluation Sheet Styles --- */
.evaluation-sheet {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.sheet-header {
    padding: 2rem;
    text-align: center;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
}

.sheet-header h3 {
    margin: 0;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 600;
}

.sheet-header-compact {
    padding: 1rem 1.5rem;
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    border-bottom: 1px solid #e2e8f0;
}

.position-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.sheet-header-compact .eval-position {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1e293b;
}

.behavior-count-badge {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(99, 102, 241, 0.3);
}

.eval-position {
    margin-top: 0.5rem;
    color: #64748b;
    font-size: 1.1rem;
    font-weight: 500;
}

.sheet-body {
    padding: 2rem;
}

.competency-block {
    margin-bottom: 2rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.competency-header {
    background: #f1f5f9;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.competency-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
}

.competency-meta {
    font-size: 0.85rem;
    color: #64748b;
    background: #e2e8f0;
    padding: 4px 8px;
    border-radius: 4px;
}

.behaviors-list {
    padding: 0;
}

.behavior-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    gap: 2rem;
}

.behavior-row:last-child {
    border-bottom: none;
}

.behavior-text {
    flex: 1;
    color: #475569;
    font-size: 0.85rem;
    line-height: 1.5;
}

.rating-container {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.rating-option {
    cursor: pointer;
    position: relative;
}

.rating-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.rating-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #cbd5e1;
    color: #64748b;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.rating-option input[type="radio"]:checked+.rating-circle {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
}

.rating-option:hover .rating-circle {
    border-color: var(--primary);
    color: var(--primary);
}

.rating-option input[type="radio"]:checked:hover+.rating-circle {
    color: white;
}

.empty-state-card {
    text-align: center;
    padding: 3rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    color: #94a3b8;
}

.empty-state-card i {
    font-size: 3rem;
    margin-bottom: 0.75rem;
    color: #cbd5e1;
}

/* Response styles media query */
@media (max-width: 768px) {
    .behavior-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .rating-container {
        width: 100%;
        justify-content: space-between;
    }
}

.form-select-premium { padding: 0.75rem 2.5rem 0.75rem 1rem; border: 1px solid #e2e8f0; border-radius: 8px; font-size: 0.95rem; background: #f8fafc; transition: var(--transition); cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; background-size: 1rem; min-width: 200px; font-family: inherit; color: var(--text-main); } .form-select-premium:focus { background-color: var(--white); border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); outline: none; }



/* Photo Tooltip */
.photo-tooltip-wrapper:hover .photo-tooltip { display: block !important; }

/* Custom Tooltip */
[data-tooltip] {
    position: relative;
}

[data-tooltip]::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: #1e293b;
    color: white;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: none;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}

/* Tooltip Arrow */
[data-tooltip]::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: none;
}

[data-tooltip]:hover::before,
[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
[data-tooltip]:hover::after {
    transform: translateX(-50%) translateY(6px);
}

/* --- Global Notifications App --- */
.nav-notification-btn {
    position: relative;
    background: transparent;
    border: none;
    font-size: 1.25rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1rem;
}
.nav-notification-btn:hover {
    background: #f1f5f9;
    color: #1e293b;
}
.nav-notification-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ef4444;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid white;
}
.global-notification-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 320px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border: 1px solid #e2e8f0;
    z-index: 9999;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transform-origin: top right;
    animation: dropIn 0.2s ease;
}
.global-notification-dropdown.active {
    display: flex;
}
@keyframes dropIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}
.notif-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}
.notif-dropdown-header h4 {
    margin: 0;
    font-size: 0.95rem;
    color: #1e293b;
}
.notif-mark-all {
    font-size: 0.8rem;
    color: #3b82f6;
    cursor: pointer;
    background: none;
    border: none;
}
.notif-mark-all:hover {
    text-decoration: underline;
}
.notif-list {
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
    margin: 0;
    list-style: none;
}
.notif-item {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    gap: 12px;
}
.notif-item:hover {
    background: #f8fafc;
}
.notif-item.unread {
    background: #eff6ff;
}
.notif-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #4f46e5;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}
.notif-content p {
    margin: 0 0 4px 0;
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.4;
}
.notif-content span.date {
    font-size: 0.75rem;
    color: #94a3b8;
}
.notif-empty {
    padding: 2rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* Tooltip en dessous */
[data-tooltip-bottom] {
    position: relative;
}

[data-tooltip-bottom]::before {
    content: attr(data-tooltip-bottom);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: white;
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    font-size: 0.85rem;
    white-space: normal;
    width: max-content;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: none;
    text-align: center;
    line-height: 1.4;
    font-weight: 500;
}

[data-tooltip-bottom]::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: transparent transparent #1e293b transparent;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 99999;
    pointer-events: none;
}

[data-tooltip-bottom]:hover::before,
[data-tooltip-bottom]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
[data-tooltip-bottom]:hover::after {
    transform: translateX(-50%) translateY(-6px);
}
