/* STYLE.CSS CORRIGÉ - THÈME GRIS AVEC LAYOUT FIXÉ */

/* Couleurs personnalisées - Thème gris plus sombre pour les pages */
:root {
    --primary-color: #6c757d;
    --secondary-color: #adb5bd;
    --accent-color: #495057;
    --light-gray: #f8f9fa;
    --medium-gray: #dee2e6;
    --dark-gray: #6c757d;
    --text-primary: #212529;
    --text-secondary: #6c757d;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

body {
    padding-top: 80px;
    font-size: 0.85rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    margin: 0;
    overflow-x: hidden;
}

/* Typography - Tailles réduites */
h1, .h1 { font-size: 1.8rem; font-weight: 600; }
h2, .h2 { font-size: 1.6rem; font-weight: 600; }
h3, .h3 { font-size: 1.4rem; font-weight: 600; }
h4, .h4 { font-size: 1.2rem; font-weight: 600; }
h5, .h5 { font-size: 1rem; font-weight: 600; }
h6, .h6 { font-size: 0.9rem; font-weight: 600; }

/* HEADER FIXE */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1030;
    height: 80px;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
    background-color: var(--dark-gray) !important;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.1rem;
    color: white !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: rgba(255,255,255,0.8) !important;
}

.navbar-brand img {
    transition: transform 0.2s ease;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    border-radius: 4px;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.navbar-brand small {
    font-size: 0.65rem;
    line-height: 1;
    margin-top: -2px;
    display: block;
    opacity: 0.8;
}

/* User dropdown */
.user-dropdown img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
}

.dropdown-toggle::after {
    display: none !important;
}

.dropdown-menu {
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
}

.dropdown-item {
    padding: 8px 16px;
    transition: background-color 0.2s ease;
    font-size: 0.85rem;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
}

.nav-link:hover {
    background-color: rgba(255,255,255,0.1) !important;
    border-radius: 6px;
}

/* SIDEBAR CORRIGÉE */
.sidebar {
    position: fixed;
    top: 80px;
    left: 0;
    width: 250px;
    height: calc(100vh - 80px);
    background-color: #f8f9fa;
    border-right: 1px solid #dee2e6;
    overflow-y: auto;
    z-index: 1020;
    transition: transform 0.3s ease;
    padding: 1rem 0;
    box-shadow: 2px 0 4px rgba(0,0,0,0.1);
}

.sidebar .nav {
    padding: 0;
}

.sidebar .nav-link {
    color: #495057;
    padding: 12px 20px;
    border-radius: 0;
    transition: all 0.2s ease;
    font-size: 0.85rem;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover {
    background-color: var(--medium-gray);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
}

.sidebar .nav-link.active {
    background-color: var(--primary-color);
    color: white;
    border-left-color: var(--accent-color);
    font-weight: 600;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* CONTENU PRINCIPAL - CORRECTION CRUCIALE */
.main-content,
.col-md-9.ms-sm-auto.col-lg-10,
main.col-md-9.ms-sm-auto.col-lg-10,
main {
    margin-left: 250px !important;
    padding: 20px !important;
    min-height: calc(100vh - 80px);
    width: calc(100% - 250px) !important;
    max-width: none !important;
    box-sizing: border-box;
    background-color: #fff;
    position: relative;
}

/* Container fluid corrections */
.container-fluid {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
}

.container-fluid .row {
    margin: 0 !important;
    width: 100%;
}

/* Corrections pour les colonnes Bootstrap */
.col-md-9.ms-sm-auto.col-lg-10 {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 250px !important;
    width: calc(100% - 250px) !important;
    max-width: none !important;
    flex: none !important;
}

/* RESPONSIVE MOBILE */
@media (max-width: 768px) {
    body {
        padding-top: 70px;
    }
    
    .navbar {
        height: 70px;
        padding: 8px 15px;
    }
    
    .sidebar {
        transform: translateX(-100%);
        top: 70px;
        height: calc(100vh - 70px);
    }
    
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 20px rgba(0,0,0,0.3);
    }
    
    .main-content,
    .col-md-9.ms-sm-auto.col-lg-10,
    main.col-md-9.ms-sm-auto.col-lg-10,
    main {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px !important;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
    
    .navbar-brand small {
        font-size: 0.6rem;
    }
    
    h1, .h1 { font-size: 1.5rem; }
    h2, .h2 { font-size: 1.3rem; }
}

/* CARDS ET COMPOSANTS */
.card {
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.card-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

.stat-card {
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    border: none;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* TABLEAUX - CORRECTION IMPORTANTE POUR LA VISIBILITÉ */
.table {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.table th {
    border-top: none;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    background-color: #f8f9fa;
    padding: 12px 8px;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* CORRECTION CRITIQUE: Titres de tableaux avec style bleu Windows */
/* Dans assets/css/style.css */
.table-dark th {
    color: #ffffff !important;
    background: linear-gradient(135deg, #0078d4, #106ebe) !important;
    font-weight: 700 !important;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5) !important;
    /* ... autres propriétés pour une meilleure visibilité */
}

.table-dark th,
.table-dark td {
    border-color: #0066cc !important;
}

/* Assurer que le texte est bien visible */
.table thead th {
    position: relative;
    z-index: 1;
}

.table td {
    padding: 10px 8px;
    vertical-align: middle;
    border-top: 1px solid #dee2e6;
}

.table-hover tbody tr:hover {
    background-color: rgba(0,123,255,0.08);
    transition: all 0.2s ease;
}

.table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(0,0,0,0.02);
}

/* BADGES */
.badge {
    font-size: 0.7rem;
    padding: 6px 10px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* BOUTONS */
.btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-width: 1px;
    font-size: 0.85rem;
    padding: 8px 16px;
}

.btn-sm {
    padding: 4px 8px;
    font-size: 0.75rem;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* FORMULAIRES */
.form-control,
.form-select {
    border-radius: 6px;
    border: 1px solid #ced4da;
    padding: 8px 12px;
    font-size: 0.85rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(108, 117, 125, 0.25);
    outline: none;
}

.form-label {
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
    font-size: 0.85rem;
}

.form-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* MODALS */
.modal-content {
    border-radius: 10px;
    border: none;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px;
}

/* ALERTES */
.alert {
    border-radius: 8px;
    border: none;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.alert-dismissible .btn-close {
    padding: 12px 16px;
}

/* COULEURS BOOTSTRAP OVERRIDE */
.bg-primary { background-color: var(--primary-color) !important; }
.text-primary { color: var(--primary-color) !important; }
.border-primary { border-color: var(--primary-color) !important; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

.btn-primary:focus {
    box-shadow: 0 0 0 0.2rem rgba(173, 181, 189, 0.25);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* CORRECTIONS SPÉCIALES POUR LA PAGE DE RAPPORTS */
.top-department-item {
    border-left: 4px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: 8px;
}

.top-department-item:hover {
    border-left-color: var(--primary-color);
    background-color: rgba(108, 117, 125, 0.1);
}

.top-department-item.bg-light {
    background-color: rgba(248, 249, 250, 0.8) !important;
}

/* UTILITAIRES */
.border-bottom {
    border-color: var(--medium-gray) !important;
}

.text-muted {
    color: var(--text-secondary) !important;
}

.bg-light {
    background-color: var(--light-gray) !important;
}

/* ANIMATIONS */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* SCROLLBAR CUSTOM */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sidebar::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* FIXES SPÉCIAUX POUR LES PAGES */
.px-md-4 {
    padding-left: 1.5rem !important;
    padding-right: 1.5rem !important;
}

/* Corrections pour éviter les débordements */
.container-xxl,
.container-xl,
.container-lg,
.container-md,
.container-sm,
.container {
    max-width: none !important;
    padding: 0 !important;
}

/* Avatar utilisateur */
.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-md {
    width: 48px;
    height: 48px;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Progress bars */
.progress {
    height: 8px;
    border-radius: 4px;
    background-color: #e9ecef;
}

.progress-bar {
    border-radius: 4px;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.status-dot.online { background-color: var(--success-color); }
.status-dot.offline { background-color: var(--text-secondary); }
.status-dot.busy { background-color: var(--danger-color); }
.status-dot.away { background-color: var(--warning-color); }

/* File icons */
.file-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
}

.file-icon.pdf { background-color: #dc3545; }
.file-icon.doc { background-color: #007bff; }
.file-icon.xls { background-color: #28a745; }
.file-icon.img { background-color: #ffc107; }

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --light-gray: #343a40;
        --medium-gray: #495057;
        --text-primary: #f8f9fa;
        --text-secondary: #adb5bd;
    }
}

/* Print styles */
@media print {
    .navbar,
    .sidebar,
    .btn,
    .dropdown {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0 !important;
        width: 100% !important;
    }
    
    body {
        padding-top: 0;
    }
}