/* DOCMANAGER - CSS UNIFIÉ */
/* Art Consortium Design System */

:root {
    --primary-color: #1f0173;
    --primary-transparent: rgba(31, 1, 115, 0); /* Version complètement transparente */
    --accent-gold: #200273; /* Remplacé par le bleu demandé */
    --accent-silver: #c0c0c0;
    --text-light: #ffffff;
    --text-dark: #000000;
    --glass-bg: rgba(255, 255, 255, 0.1); /* Effet verre transparent */
    --glass-bg-sidebar: rgba(31, 1, 115, 0.98); /* Sidebar solide pour lisibilité */
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.3);
    --shadow-strong: 0 16px 64px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    background: url('/static/images/home-bg-hero-desktop.avif') center center / cover no-repeat, var(--primary-transparent);
    background-attachment: fixed;
    min-height: 100vh;
    overflow-x: hidden;
    padding-top: 70px;
}

/* FORCE WHITE TEXT - EXCEPT PROTECTION NOTICES AND DOCUMENT HEADERS */
/* TEMPORARILY DISABLED TO TEST DOCUMENT HEADER H2 COLOR */
/*
*:not(.protection-notice) {
    color: #ffffff !important;
}

*:not(.btn):not(.badge):not(.alert):not(.notice):not(.protection-notice) {
    color: #ffffff !important;
}
*/

/* SPECIFIC WHITE TEXT RULES INSTEAD OF UNIVERSAL */
p, span, div:not(.document-header), a, li, td, th, label, input, textarea, select {
    color: #ffffff !important;
}

/* OVERRIDE: Document header H2 must be excluded from white text rule */
.document-header h2 {
    color: #1f0173 !important;
}

/* FORCE OVERRIDE with even higher specificity */
html body .document-header h2 {
    color: #1f0173 !important;
}

/* EXCEPTION: Document header H2 should NOT be white */
.document-header h2 {
    color: #1f0173 !important;
}

/* FORCE OVERRIDE for document header H2 with maximum specificity */
html body .document-header h2 {
    color: #1f0173 !important;
    font-weight: 600 !important;
}

/* ULTIMATE OVERRIDE - Multiple selectors with maximum specificity */
html body .document-header h2,
html body div.document-header h2,
body .document-header h2,
.document-header h2 {
    color: #1f0173 !important;
    font-weight: 600 !important;
}


/* CONTAINERS ET LAYOUT */
.container {
    margin: 0 auto;
    padding: 0 20px;
}

/* GLASSMORPHISME AVANCÉ */
.glass-card,
.main-header {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

/* SIDEBAR - Fond solide pour meilleure lisibilité (pas de glassmorphisme) */
.sidebar {
    background: var(--glass-bg-sidebar) !important;
    border-right: 1px solid var(--glass-border) !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.4) !important;
}

.main-content {
    padding: 2rem;
    transition: margin-left 0.3s ease;
}

/* Main content pour les pages viewer - pas de padding, hauteur fixe */
body.viewer-page .main-content,
html body.viewer-page .main-content,
body.viewer-page main.main-content {
    padding: 0 !important; /* Écraser le padding: 2rem de base */
    margin: 0 !important; /* Aucun margin, y compris margin-top */
    height: 100vh !important; /* Pleine hauteur de l'écran */
    overflow: hidden;
    position: relative !important; /* Position relative pour contenir les enfants absolus */
}

/* Règle de force maximale pour les pages viewer */
body.viewer-page .main-content {
    padding-top: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
    padding-left: 0 !important;
}

/* Empêcher le scroll sur les pages viewer */
body.viewer-page {
    overflow: hidden;
    height: 100vh;
    /* Empêcher le zoom du navigateur sur toute la page */
    touch-action: manipulation;
}

/* Empêcher le zoom sur les éléments de l'interface */
body.viewer-page .main-header,
body.viewer-page .sidebar,
body.viewer-page .pdf-header-controls {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Permettre le zoom contrôlé uniquement sur le container PDF */
body.viewer-page .native-pdf-container {
    touch-action: pinch-zoom pan-x pan-y;
    overflow: auto !important; /* Permettre le scroll */
    position: relative;
    margin: 0 !important; /* Aucun margin */
    padding: 0 !important; /* Aucun padding */
}

/* Empêcher le zoom natif du navigateur sur le canvas PDF */
body.viewer-page .native-pdf-container canvas {
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    transition: transform 0.1s ease-out;
    cursor: grab;
}

/* Curseur lors du déplacement */
body.viewer-page .native-pdf-container canvas:active {
    cursor: grabbing;
}

/* Header avec glassmorphisme sur les pages viewer */
body.viewer-page .main-header {
    display: flex !important;
    padding: 0 2rem !important; /* Padding normal pour les contrôles */
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(20px) saturate(180%) !important;
    border-bottom: 1px solid var(--glass-border) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1) !important;
}

/* Règle déjà définie plus haut */

/* Main content avec sidebar ouverte sur desktop */
@media (min-width: 769px) {
    body.sidebar-open .main-content {
        margin-left: 280px;
    }
    
    /* Spécifique pour les pages viewer avec sidebar - aucun margin */
    body.sidebar-open.viewer-page .main-content {
        margin-left: 0 !important; /* Aucun margin même avec sidebar */
        padding: 0 !important;
    }
}

/* GLASSMORPHISME - CONTAINERS (EXCEPT LOGIN-CARD) */
.card:not(.login-card), 
.profile-card, 
.section-card, 
.stat-card, 
.content-card, 
.glass-card:not(.login-card),
.empty-state, 
.login-prompt,
.form:not(.login-card .form), 
.modal-content {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    -webkit-backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    box-shadow: var(--shadow-soft) !important;
    color: var(--text-light) !important;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Cartes de documents plus compactes */
.grid .card {
    padding: 1.2rem !important;
    margin-bottom: 0 !important;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    max-width: 100%;
    transition: all 0.3s ease;
}

.grid .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Bouton d'arrêt d'impersonation dans la sidebar */
.impersonation-exit {
    color: #ff6b6b !important;
    font-weight: 500;
    padding: 0.75rem 1rem !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.impersonation-exit:hover {
    background: rgba(255, 107, 107, 0.1) !important;
    color: #ff5252 !important;
    transform: translateX(2px);
}

.impersonation-exit i {
    margin-right: 0.5rem;
}

/* Documents section transparente */
.documents-section {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* TABLES */
table, 
.admin-table, 
.admin-table-container {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    border: 1px solid var(--glass-border) !important;
    border-radius: 16px !important;
    color: var(--text-light) !important;
    width: 100%;
    border-collapse: collapse;
}

table th,
table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--glass-border);
    color: var(--text-light) !important;
}

table th {
    background: rgba(31, 1, 115, 0.9) !important;
    font-weight: 600;
}

/* INPUTS ET FORMS */
input, 
textarea, 
select {
    background: rgba(31, 1, 115, 0) !important;
    color: var(--text-light) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    width: 100%;
    margin-bottom: 1rem;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(32, 2, 115, 0.2);
}

/* BUTTONS */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--accent-gold);
    color: white;
}

.btn-primary:hover {
    background: #2a0399;
    transform: translateY(-2px);
}

.btn-success {
    background: var(--accent-gold);
    color: var(--text-light);
    border: none;
}

.btn-success:hover {
    background: #2a0399;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--glass-bg);
    color: var(--text-light);
    border: 1px solid var(--glass-border);
}

.btn-secondary:hover {
    background: rgba(31, 1, 115, 0.9);
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: var(--text-light);
}

.btn-danger:hover {
    background: #c82333;
    transform: translateY(-2px);
}

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

/* BADGES */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--accent-gold);
    color: var(--text-dark);
}

.badge-secondary {
    background: var(--accent-silver);
    color: var(--text-dark);
}

.badge-info {
    background: #17a2b8;
    color: var(--text-light);
}

.badge-success {
    background: #28a745;
    color: var(--text-light);
}

.badge-danger {
    background: #dc3545;
    color: var(--text-light);
}

/* ACCESS BADGES (visible uniquement aux admins) */
.card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.access-badge.owner {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    color: #1a1a1a;
    box-shadow: 0 2px 4px rgba(255, 215, 0, 0.3);
}

.access-badge.assigned {
    background: linear-gradient(135deg, #4ade80, #22c55e);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(74, 222, 128, 0.3);
}

.access-badge.category {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
    color: #ffffff;
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.3);
}

.access-badge i {
    font-size: 0.7rem;
}

/* GRIDS */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    justify-content: center;
    align-items: start;
    margin-top: 2rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* ADMIN PAGES */
body.admin-page {
    background: url('/static/images/home-bg-hero-desktop.avif') center center / cover no-repeat, var(--primary-transparent);
    background-attachment: fixed;
}

.admin-header {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    color: var(--text-light) !important;
    padding: 2rem !important;
    border-radius: 16px !important;
    border: 1px solid var(--glass-border) !important;
    margin-bottom: 2rem !important;
    text-align: center;
}

.admin-header h1,
.admin-header h2,
.admin-header p {
    color: var(--text-light) !important;
}

.admin-actions {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    color: var(--text-light) !important;
    padding: 2rem !important;
    border-radius: 16px !important;
    border: 1px solid var(--glass-border) !important;
}

.action-card {
    background: var(--glass-bg) !important;
    backdrop-filter: blur(20px) !important;
    color: var(--text-light) !important;
    padding: 2rem !important;
    border-radius: 16px !important;
    border: 1px solid var(--glass-border) !important;
    text-decoration: none !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 1rem !important;
}

.action-card:hover {
    transform: translateY(-5px) !important;
    background: rgba(31, 1, 115, 0.95) !important;
}

.action-card i {
    font-size: 2.5rem !important;
    color: var(--accent-gold) !important;
    margin-bottom: 0.5rem !important;
}

.action-card h4,
.action-card p {
    color: var(--text-light) !important;
}

/* SIDEBAR */
.sidebar {
    position: fixed;
    top: 70px; /* Commence sous le header */
    left: 0;
    width: 280px;
    height: calc(100vh - 70px); /* Hauteur ajustée */
    background: var(--glass-bg-sidebar); /* Plus opaque pour meilleure lisibilité */
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    padding: 1rem;
    padding-bottom: 0; /* Supprimé car plus besoin */
    z-index: 1000;
    display: flex;
    flex-direction: column;
}


/* Sidebar ouverte */
.sidebar.open {
    transform: translateX(0);
}


.sidebar-nav {
    flex: none; /* Ne pas prendre tout l'espace */
    flex-shrink: 0; /* Ne pas rétrécir */
    order: -1; /* Forcer à être en premier */
    position: relative;
    z-index: 10; /* Au-dessus des catégories */
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    margin-bottom: 0.5rem; /* Réduire l'espacement */
    padding: 0.5rem 0; /* Padding compact */
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.25rem; /* Espacement réduit entre les items */
}

/* S'assurer que tous les liens de navigation sont visibles */
.sidebar-nav .nav-link {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}


.sidebar-nav a {
    display: block;
    padding: 0.5rem 0.75rem; /* Padding réduit */
    color: var(--text-light);
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 0.875rem; /* Taille de police réduite */
    line-height: 1.2; /* hauteur de ligne compacte */
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
    background: rgba(31, 1, 115, 0.9);
    color: var(--accent-gold);
}

/* Navigation dividers */
.nav-divider {
    padding: 0.25rem 0.75rem; /* Padding réduit */
    font-size: 0.7rem; /* Police plus petite */
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-gold);
    border-top: 1px solid var(--glass-border);
    margin-top: 0.25rem; /* Marge réduite */
    background: none !important;
}

.nav-divider:empty {
    height: 1px;
    padding: 0;
    margin: 0.25rem 0.75rem; /* Marges réduites */
    border-top: 1px solid var(--glass-border);
}

/* SIDEBAR TOGGLE - Maintenant géré par le logo */

/* OVERLAY */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* MODALS */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    backdrop-filter: blur(20px);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
}

.modal-close:hover {
    color: var(--accent-gold);
}

/* Centrer les contrôles PDF dans le header (toutes tailles d'écran) */
.pdf-header-controls {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    gap: 2rem;
    z-index: 10;
}

/* Masquer complètement le header sur les pages viewer pour toutes les tailles d'écran */
body.viewer-page .main-header {
    display: none !important;
}

/* Ajuster le main-content pour utiliser toute la hauteur */
body.viewer-page .main-content {
    height: 100vh !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow-y: auto !important;
}

/* Styles pour l'affichage de toutes les pages */
body.viewer-page .all-pages-container {
    width: 100%;
    padding: 20px;
    background: var(--bg-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

body.viewer-page .all-pages-container canvas {
    margin-bottom: 20px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .main-content.with-sidebar {
        margin-left: 0;
    }
    
    /* Forcer le margin-left à 0 sur mobile pour toutes les pages */
    .main-content {
        margin: 0 !important;
    }
    
    /* Aucun margin pour le pdf-viewer-container sur mobile */
    body.viewer-page #pdf-viewer-container {
        margin: 0 !important;
        margin-top: 0 !important; /* Aucun margin-top */
        padding: 0 !important;
        height: 100% !important; /* Prendre toute la hauteur du main-content */
        width: 100% !important;
        position: relative !important; /* Position relative */
        top: 0 !important; /* Pas de décalage */
        left: 0 !important; /* Pas de décalage */
    }
    
    /* Aucun espace pour le native-pdf-container sur mobile ET centrer */
    body.viewer-page .native-pdf-container {
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
    }
    
    .sidebar {
        width: 280px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .admin-stats {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: 1fr;
    }
}

/* UTILITIES */
.text-center {
    text-align: center;
}

.text-left {
    text-align: left;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }
.p-4 { padding: 2rem; }

.d-none { display: none; }
.d-block { display: block; }
.d-flex { display: flex; }
.d-grid { display: grid; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

/* HEADER */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: var(--glass-bg);
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    z-index: 1100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-container {
    display: flex;
    align-items: center;
    margin-left: 0; /* Plus de sidebar-toggle */
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s ease;
}

.logo-container:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    height: 35px;
    width: auto;
    max-width: 200px;
    object-fit: contain;
}

/* Document info dans le header (pages viewer uniquement) */
.header-document-info {
    display: flex;
    flex-direction: column;
    margin-left: 2rem;
    flex: 1;
}

.header-document-title {
    display: none !important;
}

/* Styles globaux pour les pages PDF */
#current-page {
    background: transparent !important;
    box-shadow: none !important;
}

#current-page-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Viewer PDF sans background ni border */
#flipbook-viewer {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Classes CSS3D transparentes */
.css3d-flipbook,
.css3d-flipbook-normal,
.css3d-flipbook-fullscreen {
    background: transparent !important;
}

/* Conteneurs responsives */
.minimal-flipbook-container,
.normal-flipbook-container,
.modern-flipbook-container {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Force la responsivité complète */
#flipbook-viewer,
.css3d-flipbook,
.css3d-flipbook-normal,
.css3d-flipbook-fullscreen,
.current-page-normal,
.current-page-fullscreen,
.book-container-normal,
.book-container-fullscreen {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    flex: 1 !important;
}

/* Forcer le resize sur tous les éléments du viewer */
#flipbook-viewer * {
    box-sizing: border-box !important;
}

/* Responsive pour tous les conteneurs */
.minimal-flipbook-container *,
.normal-flipbook-container *,
.modern-flipbook-container * {
    max-width: 100% !important;
    max-height: 100% !important;
}


/* Masquer le user-menu du header à toutes les largeurs */
.user-menu {
    display: none !important;
}


.user-menu-toggle {
    background: none;
    border: none;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.user-menu-toggle:hover {
    background: rgba(31, 1, 115, 0.5);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

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

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background: rgba(31, 1, 115, 0.5);
    color: var(--accent-gold);
}

.dropdown-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 0.5rem 0;
}

.auth-buttons {
    display: flex;
    gap: 1rem;
}

/* AUTH PAGES - NO HEADER */
body.auth-page {
    padding-top: 0;
}

.auth-content {
    padding: 0;
    margin: 0;
}

/* VIEWER PAGES - SIDEBAR VISIBLE (same as home page) */
/* Sidebar is now visible on viewer pages like on home page */

/* VIEWER PAGES - DOCUMENT HEADER STYLING */
body.viewer-page .document-header h2,
html body.viewer-page .document-header h2,
body.viewer-page div.document-header h2 {
    color: #1f0173 !important;
    font-weight: 600 !important;
}

/* ADJUST BODY FOR FIXED HEADER - Already set above */

/* STAT CARDS SPECIFIC */
.stat-card {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
}

.stat-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-gold);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--text-dark);
}

.stat-content h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    color: var(--text-light);
}

.stat-content p {
    font-size: 0.875rem;
    color: var(--accent-silver);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}




/* CATEGORY AND DOCUMENT LISTS */
.sidebar-section {
    margin-bottom: 2rem;
    position: relative;
    z-index: 1; /* En dessous de la navigation */
    flex: 1; /* Prend l'espace restant */
    overflow-y: auto; /* Scroll si nécessaire */
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

.sidebar-section h4 {
    color: var(--accent-gold);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.document-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-count {
    background: var(--accent-gold);
    color: var(--text-dark);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.document-list {
    list-style: none;
    margin-left: 0; /* Plus d'indentation car plus de catégories */
    margin-top: 0.5rem;
}

.document-item {
    margin-bottom: 0.25rem;
}

.document-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.5rem;
    color: var(--accent-silver);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 6px;
    transition: all 0.3s ease;
  }

  .document-link:hover {
    background: rgba(255, 255, 255, 0.15);
  }

  .document-preview {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .document-thumbnail-small {
    width: 40px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
  }

  .document-icon {
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.2rem;
    flex-shrink: 0;
  }

  .document-details {
    flex: 1;
    min-width: 0;
  }

  .document-title {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
  }

  .document-description {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.2;
    word-wrap: break-word;
  }

  /* Indicateurs d'accès pour les admins dans la sidebar */
  .document-access-info {
    margin-top: 0.25rem;
  }

  .access-type {
    display: inline-block;
    padding: 0.125rem 0.375rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .access-type.owner {
    background: var(--accent-gold);
    color: var(--text-dark);
  }

  .access-type.assigned {
    background: #28a745;
    color: white;
  }

  .access-type.category {
    background: #007bff;
    color: white;
  }

/* Styles pour les cards avec miniatures */
.card-thumbnail {
  width: 100%;
  height: 150px;
  overflow: hidden;
  border-radius: 16px 16px 0 0;
  background: rgba(255, 255, 255, 0.05);
}

.card-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.card:hover .card-thumbnail img {
  transform: scale(1.05);
}

.card-content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.card-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-description {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.4;
  margin-bottom: 1rem;
  flex: 1;
}

.card-meta {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.card .btn {
  align-self: flex-start;
  margin-top: auto;
}

/* Styles pour les miniatures dans le profil */
.document-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
}

.document-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.document-thumbnail-container {
  flex-shrink: 0;
}

.document-thumbnail-profile {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.document-info {
  flex: 1;
  min-width: 0;
}

.document-description-profile {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
  margin: 0.5rem 0;
  line-height: 1.4;
}

/* Styles pour les documents récents dans le dashboard admin */
.admin-recent {
  margin-top: 3rem;
}

.admin-recent h3 {
  color: var(--text-light);
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recent-documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.recent-document-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.recent-document-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
}

.recent-document-thumbnail,
.recent-document-placeholder {
  width: 100%;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.recent-document-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.recent-document-placeholder {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.4);
  font-size: 2rem;
}

.recent-document-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.recent-document-info h4 {
  color: var(--text-light);
  margin-bottom: 0.75rem;
  font-size: 1.1rem;
  font-weight: 600;
  line-height: 1.3;
}

.recent-document-description {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  flex: 1;
}

.recent-document-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.recent-document-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.recent-document-categories {
  display: flex;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.recent-document-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
}

/* LOGIN PAGE STYLES */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

/* Adjust for pages with header */
body:not(.auth-page) .login-container {
    min-height: calc(100vh - 70px);
}

/* LOGIN CARD - OLD TRANSPARENT STYLES (DISABLED FOR BREAKGLASS) */
/*
.login-container .login-card,
div.login-card,
.auth-page .login-card {
    max-width: 500px !important;
    width: 100% !important;
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    border: none !important;
    border-top: none !important;
    border-bottom: none !important;
    border-left: none !important;
    border-right: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    text-align: center !important;
    box-shadow: none !important;
    overflow: hidden !important;
}
*/

/* OVERRIDE ALL CARD STYLES FOR LOGIN (DISABLED FOR BREAKGLASS) */
/*
.auth-page .login-card.card,
.auth-page .login-card.glass-card,
.auth-page .login-card.content-card {
    background: transparent !important;
    background-color: transparent !important;
    backdrop-filter: none !important;
    border: none !important;
    box-shadow: none !important;
}
*/

.login-card h2 {
    display: none;
}

.login-card .form {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    backdrop-filter: none;
}

.login-card label {
    display: block;
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-align: left;
    padding: 0;
    padding-top: 1.5rem;
}

.login-card input {
    width: 100%;
    padding: 1rem 0;
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 0;
    color: var(--text-light);
    font-size: 1rem;
    margin-bottom: 0;
    transition: all 0.3s ease;
}

.login-card input:focus {
    outline: none;
    border-bottom-color: var(--text-light);
    background: rgba(255, 255, 255, 0.05);
}

.login-card input::placeholder {
    color: rgba(255, 255, 255, 0.6);
    font-style: italic;
}

.login-card .btn {
    width: 100%;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.9);
    color: #48426b !important;
    border: none;
    border-radius: 0;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 2rem;
    margin-bottom: 0;
}

.login-card .btn:hover {
    background: rgba(255, 255, 255, 1);
    color: #48426b !important;
    transform: none;
    box-shadow: none;
}

.login-card .btn:active {
    transform: none;
}

.login-card .btn:disabled {
    background: rgba(255, 255, 255, 0.5);
    color: #48426b !important;
    cursor: not-allowed;
    transform: none;
}

.login-card .btn.loading {
    position: relative;
    color: transparent;
}

.login-card .btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #48426b;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* NOTICE STYLES FOR LOGIN */
.login-card .notice {
    padding: 1rem 2rem;
    border-radius: 0;
    margin-top: 1rem;
    font-weight: 500;
    text-align: center;
    font-size: 0.875rem;
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.login-card .notice.info {
    background: rgba(32, 2, 115, 0.1);
    color: #200273;
}

.login-card .notice.success {
    background: rgba(32, 2, 115, 0.1);
    color: #200273;
}

.login-card .notice.error {
    background: rgba(220, 53, 69, 0.3);
    color: #ffffff;
    border: 1px solid rgba(220, 53, 69, 0.5);
}

/* LOGIN FORM TRANSITIONS */
.login-card .form {
    transition: all 0.3s ease;
}

.login-card .form[style*="display: none"] {
    opacity: 0;
    transform: translateY(-10px);
}

.login-card .form:not([style*="display: none"]) {
    opacity: 1;
    transform: translateY(0);
}

/* BREAKGLASS EFFECT FOR LOGIN CARD ONLY */
.login-card {
    position: relative !important;
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) brightness(0.9) contrast(1.1) !important;
    -webkit-backdrop-filter: blur(12px) brightness(0.9) contrast(1.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 16px !important;
    padding: 3rem 2rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    max-width: 500px !important;
    width: 100% !important;
    margin: 0 auto !important;
}

/* LOGIN TITLE STYLING */
.login-title {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 2.5rem !important;
    font-weight: 400 !important;
    color: #ffffff !important;
    text-align: center !important;
    margin: 0 0 3rem 0 !important;
    letter-spacing: -0.02em !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

/* MODERN BUTTON STYLING - BASED ON IMAGE */
.login-card .btn {
    width: 100% !important;
    padding: 1rem 2rem !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #333333 !important;
    border: 1px solid rgba(255, 255, 255, 0.8) !important;
    border-radius: 8px !important;
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1rem !important;
    font-weight: 500 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    margin-top: 2rem !important;
    margin-bottom: 0 !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.login-card .btn:hover {
    background: rgba(255, 255, 255, 1) !important;
    color: #333333 !important;
    border-color: rgba(255, 255, 255, 1) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.login-card .btn:active {
    transform: translateY(0) !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.login-card .btn:disabled {
    background: rgba(255, 255, 255, 0.6) !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

.login-card .btn.loading {
    position: relative !important;
    color: transparent !important;
}

.login-card .btn.loading::after {
    content: '' !important;
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    width: 20px !important;
    height: 20px !important;
    margin: -10px 0 0 -10px !important;
    border: 2px solid #333333 !important;
    border-top-color: transparent !important;
    border-radius: 50% !important;
    animation: spin 1s linear infinite !important;
}

/* RESPONSIVE */
@media (max-width: 768px) {
    .login-container {
        padding: 1rem;
    }
    
    .login-card {
        padding: 2rem 1.5rem !important;
        border-radius: 12px !important;
    }
    
    .logo-container {
        margin-left: 0; /* Plus de sidebar-toggle sur mobile */
    }
    
    .login-title {
        font-size: 2rem !important;
        margin-bottom: 2rem !important;
    }
}

/* PROFILE PAGE STYLES */
.profile-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.profile-cards {
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.profile-cards:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-gold);
}

/* CARD CLICKABLE */
.card-clickable {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.card-clickable:hover {
    text-decoration: none;
    color: inherit;
}

.card-clickable .card-title {
    color: var(--text-light);
    transition: color 0.3s ease;
}

.card-clickable:hover .card-title {
    color: var(--accent-gold);
}

.card-clickable .card-description {
    color: var(--text-muted);
}

/* Effet visuel pour indiquer que la carte est cliquable */
.card-clickable::after {
    content: '';
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 8px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-clickable {
    position: relative;
}

.card-clickable:hover::after {
    opacity: 0.6;
}

.info-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
}

.info-group:last-child {
    border-bottom: none;
}

.info-group label {
    font-weight: 600;
    color: var(--accent-gold);
}

.profile-actions {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    justify-content: center;
}

/* DOCUMENT HEADER STYLING - OVERRIDE GLOBAL WHITE TEXT */
div.document-header h2,
.document-header h2 {
    color: #1f0173 !important;
    font-weight: 600 !important;
}

/* FORCE DOCUMENT HEADER H2 COLOR */
body .document-header h2,
html .document-header h2 {
    color: #1f0173 !important;
}

/* PROTECTION NOTICE - FORCE RED COLOR */
.protection-notice,
div.protection-notice,
p.protection-notice,
span.protection-notice,
*.protection-notice {
    color: #dc3545 !important;
    font-weight: 500 !important;
}

/* OVERRIDE GLOBAL WHITE TEXT FOR PROTECTION NOTICES */
body .protection-notice,
html .protection-notice {
    color: #dc3545 !important;
}

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

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

/* FINAL OVERRIDE - DOCUMENT HEADER H2 COLOR - MUST BE LAST */
html body .document-header h2,
html body div.document-header h2,
html body.viewer-page .document-header h2,
html body.viewer-page div.document-header h2,
body .document-header h2,
body div.document-header h2,
div.document-header h2,
.document-header h2 {
    color: #1f0173 !important;
    font-weight: 600 !important;
}

/* NUCLEAR OPTION - Use CSS custom property to bypass the global rule */
.document-header h2 {
    --h2-color: #1f0173;
    color: var(--h2-color) !important;
    font-weight: 600 !important;
}

/* ULTIMATE OVERRIDE - Multiple declarations with maximum weight */
html body .document-header h2 { color: #1f0173 !important; }
html body div.document-header h2 { color: #1f0173 !important; }
body .document-header h2 { color: #1f0173 !important; }
.document-header h2 { color: #1f0173 !important; }

/* IMPERSONATION BANNER */
.impersonation-banner {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #ff6b35, #f7931e);
    border-bottom: 2px solid #e85a2b;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    padding: 0;
}

.impersonation-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
}

.impersonation-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
    font-weight: 500;
}

.impersonation-info i {
    font-size: 1.2em;
    color: white;
}

.impersonation-info strong {
    color: white;
    font-weight: 600;
}

.impersonation-info small {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85em;
    margin-left: 5px;
}

.btn-stop-impersonation {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-stop-impersonation:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
}

.btn-stop-impersonation i {
    font-size: 0.9em;
}

/* Adjust body padding when impersonation banner is active */
body:has(.impersonation-banner) {
    padding-top: 120px;
}

/* Fallback for browsers that don't support :has() */
.impersonation-active {
    padding-top: 120px !important;
}

@media (max-width: 768px) {
    .impersonation-content {
        flex-direction: column;
        gap: 10px;
        padding: 10px 15px;
    }
    
    .impersonation-info {
        text-align: center;
        font-size: 0.9em;
    }
    
    body:has(.impersonation-banner) {
        padding-top: 140px;
    }
    
    .impersonation-active {
        padding-top: 140px !important;
    }
}

/* ERROR PAGES STYLES */
body.error-page {
    padding-top: 0;
    background: url('/static/images/home-bg-hero-desktop.avif') center center / cover no-repeat, var(--primary-transparent);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.error-content {
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.error-card {
    background: rgba(255, 255, 255, 0.1) !important;
    backdrop-filter: blur(12px) brightness(0.9) contrast(1.1) !important;
    -webkit-backdrop-filter: blur(12px) brightness(0.9) contrast(1.1) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 20px !important;
    padding: 4rem 3rem !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3) !important;
    max-width: 600px !important;
    width: 100% !important;
    text-align: center !important;
    color: #ffffff !important;
}

.error-icon {
    font-size: 4rem;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.error-title {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 3rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin: 0 0 1rem 0 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
}

.error-subtitle {
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-size: 1.5rem !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    margin: 0 0 2rem 0 !important;
    opacity: 0.9;
}

.error-message {
    font-size: 1.1rem !important;
    line-height: 1.6 !important;
    color: rgba(255, 255, 255, 0.9) !important;
    margin: 0 0 3rem 0 !important;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.error-actions .btn {
    padding: 1rem 2rem !important;
    border-radius: 10px !important;
    font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, sans-serif !important;
    font-weight: 500 !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.5rem !important;
    transition: all 0.2s ease !important;
    min-width: 140px;
    justify-content: center;
}

.error-actions .btn-primary {
    background: var(--accent-gold) !important;
    color: white !important;
    border: 2px solid var(--accent-gold) !important;
}

.error-actions .btn-primary:hover {
    background: #2a0399 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(32, 2, 115, 0.3) !important;
}

.error-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.error-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1) !important;
}

.error-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 2rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.error-footer p {
    margin: 0.5rem 0;
}

.error-id {
    font-family: 'Courier New', monospace !important;
    font-size: 0.8rem !important;
    opacity: 0.6 !important;
    letter-spacing: 1px !important;
}

/* RESPONSIVE ERROR PAGES */
@media (max-width: 768px) {
    .error-container {
        padding: 1rem;
    }
    
    .error-card {
        padding: 3rem 2rem !important;
        border-radius: 16px !important;
    }
    
    .error-icon {
        font-size: 3rem;
        margin-bottom: 1.5rem;
    }
    
    .error-title {
        font-size: 2.5rem !important;
    }
    
    .error-subtitle {
        font-size: 1.3rem !important;
    }
    
    .error-message {
        font-size: 1rem !important;
        margin-bottom: 2rem !important;
    }
    
    .error-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
        margin-bottom: 2rem;
    }
    
    .error-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}

/* PDF VIEWER STYLES */
#pdf-viewer-container {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden; /* Le conteneur principal ne scroll pas */
    display: flex;
    align-items: stretch; /* Permettre au conteneur enfant de prendre toute la hauteur */
    justify-content: stretch;
    background: transparent; /* Fond transparent au lieu du bleu */
}

/* Retirer tous les margins du pdf-viewer-container sur les pages viewer */
body.viewer-page #pdf-viewer-container {
    margin: 0 !important;
    margin-top: 0 !important; /* Aucun margin-top */
    padding: 0 !important;
    height: 100% !important; /* Prendre toute la hauteur du main-content */
    width: 100% !important; /* Pleine largeur */
    position: relative !important; /* Position relative dans le main-content */
    top: 0 !important; /* Pas de décalage */
    left: 0 !important; /* Pas de décalage */
}

/* Retirer TOUS les espaces du native-pdf-container sur les pages viewer ET centrer le contenu */
body.viewer-page .native-pdf-container {
    padding: 0 !important; /* Supprimer le padding de 20px */
    margin: 0 !important; /* Supprimer tous les margins */
    border: none !important; /* Supprimer les bordures */
    top: 0 !important; /* Position au top */
    left: 0 !important; /* Position à gauche */
    width: 100% !important; /* Pleine largeur */
    height: 100% !important; /* Pleine hauteur pour le centrage vertical */
    display: flex !important; /* Utiliser flexbox pour centrer */
    align-items: center !important; /* Centrer verticalement */
    justify-content: center !important; /* Centrer horizontalement */
    flex-direction: column !important; /* Direction colonne pour un meilleur centrage */
}

.native-pdf-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: auto !important; /* C'est ce conteneur qui scroll */
    cursor: default;
    flex: 1; /* Prendre tout l'espace disponible */
    display: block !important; /* Retour en block pour scroll libre */
    padding: 20px;
    background: transparent !important; /* Fond transparent */
    box-sizing: border-box;
}

/* Centrage uniquement quand le canvas est plus petit que le conteneur */
.native-pdf-container:not(.zoomed) {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Sur les pages viewer, assurer un centrage qui permet l'adaptation */
body.viewer-page .native-pdf-container:not(.zoomed) {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    height: 100% !important;
}

/* En mode zoomé, permettre le scroll libre */
.native-pdf-container.zoomed {
    display: block !important;
    text-align: left; /* Alignement à gauche pour permettre débordement */
    padding: 0 !important; /* Supprimer le padding pour plus d'espace */
}

/* Canvas en mode zoomé SANS centrage automatique */
.native-pdf-container.zoomed #pdf-canvas {
    margin: 20px 0; /* Seulement marge verticale, PAS de centrage horizontal */
    position: relative;
    display: block;
}

#pdf-canvas {
    display: block;
    max-width: none; /* Permettre au canvas d'être plus grand que le conteneur */
    max-height: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    transition: transform 0.1s ease-out;
    flex-shrink: 0; /* Empêcher la réduction du canvas */
}

/* S'assurer que le canvas s'adapte correctement sur les pages viewer */
body.viewer-page #pdf-canvas {
    margin: 0 !important; /* Aucun margin pour un centrage parfait */
    max-width: 100% !important; /* S'adapter à la largeur du conteneur */
    max-height: 100% !important; /* S'adapter à la hauteur du conteneur */
    width: auto !important; /* Largeur automatique pour maintenir le ratio */
    height: auto !important; /* Hauteur automatique pour maintenir le ratio */
    object-fit: contain !important; /* Contenir dans le conteneur en gardant les proportions */
}

/* Styles pour le viewer en mode zoom - curseurs */
.native-pdf-container.zoomed {
    cursor: grab;
}

.native-pdf-container.zoomed:active {
    cursor: grabbing;
}

/* Scrollbars personnalisées pour le viewer PDF */
.native-pdf-container::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.native-pdf-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.native-pdf-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.native-pdf-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
    background-clip: content-box;
}

.native-pdf-container::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, 0.1);
}

/* ERROR PAGES WITH LOGIN STYLE */
.login-card .error-display {
    text-align: center;
    margin-bottom: 2rem;
}

.login-card .error-code {
    font-size: 4rem;
    font-weight: 700;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.login-card .error-message {
    font-size: 1.1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
    text-align: center;
}

.login-card .error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.login-card .error-actions .btn {
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.login-card .error-actions .btn-secondary {
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
}

.login-card .error-actions .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    transform: translateY(-2px) !important;
}

.login-card .error-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
}

.login-card .error-footer p {
    margin: 0.5rem 0;
}

.login-card .error-id {
    font-family: 'Courier New', monospace !important;
    font-size: 0.8rem !important;
    opacity: 0.6 !important;
}

/* Responsive pour les erreurs dans login-card */
@media (max-width: 768px) {
    .login-card .error-code {
        font-size: 3rem;
    }
    
    .login-card .error-actions {
        flex-direction: column;
        align-items: center;
        gap: 0.8rem;
    }
    
    .login-card .error-actions .btn {
        width: 100%;
        max-width: 280px;
    }
}
