:root {
    --primary-color: #002244; /* Bleu très foncé pour TOUT */
    --secondary-blue: #002244; /* Identique au primaire pour tout mettre en bleu foncé */
    --danger-red: #d90429;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --light-bg: #f6f6f6;
    --dark-text: #002244; /* Harmonisé avec la couleur principale */
    
    /* Surcharge des variables Bootstrap 5 */
    --bs-body-font-size: 0.875rem;
    --bs-body-color: #002244;
    --bs-body-bg: #f6f6f6;
    --bs-primary: #002244;
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem !important; /* Taille harmonisée (équivalent à .small) */
    background-color: var(--light-bg) !important;
    color: var(--dark-text) !important;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* --- Titres --- */
h1, h2, h3, h4, h5, h6, .fw-bold, .text-primary, i.text-primary, i.fa-lg, i.fa-2x {
    color: var(--primary-color) !important;
}

/* Couleur plus douce pour le texte secondaire (text-muted) basé sur le bleu */
.text-muted {
    color: #4b5a6b !important;
}

/* --- Top Bar --- */
.top-bar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--topbar-height);
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1100;
}

#sidebarCollapse {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
}

.top-bar-logo {
    margin-left: 15px;
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* --- Sidebar --- */
#sidebar {
    position: fixed;
    top: var(--topbar-height);
    left: calc(-1 * var(--sidebar-width));
    width: var(--sidebar-width);
    height: calc(100vh - var(--topbar-height));
    background: var(--primary-color);
    color: white;
    transition: all 0.3s ease-in-out;
    z-index: 1090;
}

#sidebar.active { left: 0; }

#sidebar ul li a {
    padding: 15px 25px;
    display: block;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
}

#sidebar ul li.active > a {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-left: 5px solid #fff;
}

/* --- Content --- */
#content {
    padding: 20px;
    margin-top: var(--topbar-height);
    transition: all 0.3s;
}

/* --- Lists & Tables Content --- */
table td, .list-group-item, .card-body {
    color: var(--secondary-blue) !important;
    font-size: 0.875rem !important;
}

table, .table {
    color: var(--secondary-blue) !important;
    font-size: 0.875rem !important;
}

table thead th {
    color: var(--primary-color) !important;
    font-weight: 700 !important;
    font-size: 0.875rem !important;
}

/* --- Harmonize Inputs & Selects --- */
.form-control, .form-select, input, select, textarea {
    height: 31px !important;
    min-height: 31px !important;
    padding-top: 2px !important;
    padding-bottom: 2px !important;
    font-size: 0.875rem !important;
    color: var(--secondary-blue) !important;
    font-family: 'Inter', sans-serif !important;
}

/* Les textareas peuvent avoir besoin de plus de hauteur */
textarea.form-control {
    height: auto !important;
    min-height: 80px !important;
}

/* --- Buttons --- */
.btn {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.85rem !important; /* Taille légèrement plus petite */
    font-weight: 500 !important;
    height: 31px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px !important; /* Dimensions affinées */
    border-radius: 6px !important;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}

.btn-primary {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border: none !important;
}

.btn-primary:hover {
    background-color: #003366 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

/* Bouton Supprimer */
.btn-outline-danger, .btn-danger {
    background-color: var(--danger-red) !important;
    color: #ffffff !important;
    border: none !important;
}

.btn-danger:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

.btn-danger i, .btn-outline-danger i {
    color: #ffffff !important;
}

/* --- Deletion Toast --- */
#deleteToast {
    position: fixed;
    bottom: 25%; /* Plus haut, proche de la zone d'action */
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 15px 50px rgba(0,0,0,0.5);
    z-index: 2000;
    display: none;
    align-items: center;
    gap: 20px;
}

/* --- Drag & Drop Upload Zone --- */
.upload-zone {
    position: relative;
    border: 1.5px dashed #d1d5db;
    background-color: #f9fafb;
    border-radius: 12px;
    padding: 2.5rem 1rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    overflow: hidden;
}

.upload-zone:hover {
    border-color: var(--primary-color);
    background-color: #f0f7ff;
}

.upload-zone.dragover {
    border-color: var(--primary-color);
    background-color: #eef2ff;
    transform: scale(1.01);
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(0, 34, 68, 0.05);
}

.upload-zone i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    transition: transform 0.3s ease;
}

.upload-zone.dragover i {
    transform: translateY(-5px);
}

.upload-zone p {
    margin-bottom: 0;
    color: #4b5563;
    font-size: 0.9rem;
}

.upload-zone .browse-text {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: underline;
}

/* --- File List Actions on Hover --- */
.file-row {
    transition: background-color 0.2s ease;
    border-radius: 8px;
}

.file-row:hover {
    background-color: #f3f4f6 !important;
}

.file-actions {
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    transform: translateX(10px);
}

.file-row:hover .file-actions {
    opacity: 1;
    transform: translateX(0);
}

.file-row:hover .file-actions-container {
    opacity: 1 !important;
}

.file-row:hover .edit-icon {
    opacity: 1 !important;
}

.edit-icon {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.edit-label-input:focus {
    background-color: #fff !important;
    padding-left: 5px !important;
}

.hover-primary:hover { color: var(--primary-color) !important; }
.hover-danger:hover { color: #dc3545 !important; }

.file-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.upload-zone i {
    color: var(--primary-color);
    margin-bottom: 8px;
    font-size: 1.5rem;
}

.upload-zone p {
    font-size: 0.85rem;
    margin-bottom: 0;
}

.upload-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-preview-item {
    background: #fff;
    border-radius: 8px;
    padding: 8px 15px;
    margin-top: 10px;
    border: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

/* --- Grilles de Cartes Responsives (CSS Grid) --- */
.responsive-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

/* --- Cartes Catalogue Modernes --- */
.catalogue-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 34, 68, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}
.catalogue-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 34, 68, 0.08);
    border-color: rgba(0, 34, 68, 0.2);
}
.catalogue-card-header {
    padding: 1.25rem 1.25rem 0.75rem 1.25rem;
    border-bottom: 1px solid rgba(0, 34, 68, 0.05);
}
.catalogue-card-body {
    padding: 1rem 1.25rem;
    flex-grow: 1;
}
.catalogue-card-footer {
    padding: 0.75rem 1.25rem 1.25rem 1.25rem;
    background-color: #fafbfc;
    border-top: 1px solid rgba(0, 34, 68, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Cartes Collaborateurs/Utilisateurs Modernes --- */
.user-card {
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid rgba(0, 34, 68, 0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 1.25rem;
    height: 100%;
    position: relative;
}
.user-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 34, 68, 0.08);
    border-color: rgba(0, 34, 68, 0.2);
}
.user-avatar-placeholder {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: #ffffff;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.user-card-actions {
    margin-top: auto;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 34, 68, 0.05);
}

.bg-purple {
    background-color: #6f42c1 !important;
}

