/* ========================================
   USCOUD EXACT STYLE - Copie du projet USCOUD principal
   ======================================== */

:root {
    --primary-color: #3777B0;
    --secondary-color: #2c5f8d;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --danger-color: #e74c3c;
}

body {
    background-color: #f8fafc;
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding-top: 140px;
}

/* Navbar Styles - Style COUD'MAINT */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
    z-index: 1000;
}

.logo-container {
    display: flex;
    align-items: center;
    min-width: 200px;
    flex-shrink: 0;
}

.logo-container img {
    height: 40px;
    margin-right: 10px;
    flex-shrink: 0;
}

.logo-container span {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Navigation desktop */
.desktop-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.desktop-nav li {
    margin: 0 10px;
}

.desktop-nav a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 5px;
    transition: all 0.3s;
}

.desktop-nav a:hover {
    background-color: #e9ecef;
}

.desktop-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.desktop-nav i {
    margin-right: 5px;
}

/* Menu hamburger */
.hamburger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 24px;
    color: #333;
    padding: 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.hamburger:hover,
.hamburger:focus {
    background-color: #e9ecef;
    outline: none;
}

.hamburger:active {
    transform: scale(0.95);
}

/* Animation du hamburger en X quand menu ouvert */
.hamburger[aria-expanded="true"] i::before {
    content: "\f00d" !important; /* Font Awesome times/close icon */
}

.hamburger i {
    display: inline-block;
    transition: transform 0.3s ease;
}

.hamburger[aria-expanded="true"] i {
    transform: rotate(90deg);
}

/* Navigation mobile */
.mobile-nav {
    display: none;
    width: 100%;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    z-index: 999;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-nav ul {
    list-style: none;
    padding: 15px;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mobile-nav li {
    padding: 0;
    width: 100%;
}

.mobile-nav a {
    text-decoration: none;
    color: #333;
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
    width: 100%;
}

.mobile-nav a:hover {
    background-color: #e9ecef;
}

.mobile-nav a.active {
    color: var(--primary-color);
    font-weight: 600;
    background-color: rgba(55, 119, 176, 0.1);
}

.mobile-nav i {
    margin-right: 10px;
    font-size: 1.1rem;
}

.mobile-nav.active {
    display: block;
}

/* Bouton déconnexion dans menu mobile */
.mobile-nav .btn-logout {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    margin: 5px 0 !important;
}

/* User Dropdown */
.navbar-nav .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    z-index: 1001;
    border-top: 3px solid var(--primary-color);
}

.navbar-nav .dropdown-item {
    display: block;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

tr.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
    padding-left: 25px;
    border-left-color: var(--primary-color);
}

.navbar-nav .dropdown-item:hover {
    background-color: #f8f9fa;
    color: var(--primary-color);
}

.dropdown-divider {
    height: 1px;
    background-color: #eee;
    margin: 5px 0;
}

/* Banner */
.banner {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    text-align: center;
    padding: 12px 20px;
    background: linear-gradient(135deg, #2c5f8d 0%, #3777B0 100%);
    color: white;
    z-index: 998;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.banner p {
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
    font-size: 1rem;
}

/* Ajuster la bannière sur tablette */
@media (max-width: 1024px) {
    .banner {
        padding: 10px 15px;
    }

    .banner p {
        font-size: 0.95rem;
        line-height: 1.45;
    }
}

/* Ajuster la bannière sur mobile */
@media (max-width: 768px) {
    .banner {
        padding: 10px 15px;
        top: 60px;
        left: env(safe-area-inset-left);
        right: env(safe-area-inset-right);
    }

    .banner p {
        font-size: 0.85rem;
        line-height: 1.4;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}

/* Petits mobiles */
@media (max-width: 576px) {
    .banner {
        padding: 8px 12px;
        top: 55px;
    }

    .banner p {
        font-size: 0.8rem;
        line-height: 1.35;
    }
}

/* Très petits mobiles (iPhone SE) */
@media (max-width: 480px) {
    .banner {
        padding: 8px 10px;
        top: 55px;
    }

    .banner p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* iPhone SE et petits iPhones */
@media (max-width: 375px) {
    .banner {
        padding: 7px 8px;
        top: 50px;
    }

    .banner p {
        font-size: 0.7rem;
        line-height: 1.25;
        white-space: normal;
    }
}

/* Très petits écrans */
@media (max-width: 320px) {
    body {
        padding-top: 95px; /* 48px header + 47px banner */
    }

    header {
        min-height: 48px;
        padding: 5px 6px;
    }

    .logo-container {
        min-width: 100px;
    }

    .logo-container img {
        height: 22px;
        margin-right: 4px;
    }

    .logo-container span {
        font-size: 7.5px;
        line-height: 1.1;
        letter-spacing: -0.2px;
    }

    .banner {
        padding: 6px 5px;
        top: 48px;
    }

    .banner p {
        font-size: 0.65rem;
        line-height: 1.2;
    }

    .mobile-nav.active {
        top: 48px;
        max-height: calc(100vh - 48px);
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .banner {
        padding: 6px 10px;
        top: 50px;
    }

    .banner p {
        font-size: 0.75rem;
        line-height: 1.3;
    }
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    margin-bottom: 40px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Stats Cards */
.stats-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
    transition: transform 0.3s, box-shadow 0.3s;
    overflow: hidden;
}

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

.stats-card .card-body {
    padding: 25px;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.stats-card p {
    font-size: 0.95rem;
    color: #6c757d;
    margin-bottom: 0;
}

.stats-card .icon-wrapper {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.card-primary {
    border-left: 4px solid var(--primary-color);
}

.card-warning {
    border-left: 4px solid var(--warning-color);
}

.card-success {
    border-left: 4px solid var(--success-color);
}

.card-danger {
    border-left: 4px solid var(--danger-color);
}

/* Module Cards */
.module-card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s;
    overflow: hidden;
    height: 100%;
}

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

.module-card .card-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px;
    border: none;
}

.module-card .card-header h5 {
    margin: 0;
    font-weight: 600;
}

.module-card .card-body {
    padding: 25px;
}

.module-card .btn-module {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

.module-card .btn-module:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

/* Chart Container */
.chart-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

.chart-container h5 {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 20px;
}

/* Recent Activity */
.activity-item {
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 0 8px 8px 0;
}

.activity-item:hover {
    background: #e9ecef;
}

.activity-time {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Quick Actions */
.quick-action-btn {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    margin-bottom: 15px;
}

.quick-action-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: scale(1.05);
}

/* Footer */
.footer-custom {
    background: linear-gradient(135deg, #3777B0 0%, #2c5f8d 100%);
    color: white;
    padding: 40px 0 20px 0;
    margin-top: 60px;
}

.footer-custom h5 {
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--primary-color);
}

.footer-custom a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s;
}

.footer-custom a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.footer-custom ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-custom ul li {
    margin-bottom: 10px;
}

/* Media queries */
@media (max-width: 768px) {
    .desktop-nav {
        display: none !important;
    }

    .hamburger {
        display: block !important;
        z-index: 1001;
    }

    .mobile-nav.active {
        display: block !important;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        z-index: 999;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    body {
        padding-top: 120px; /* 60px header + 60px banner */
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .hero-section p {
        font-size: 0.9rem;
    }
    
    .hero-section .col-md-4 {
        text-align: center !important;
        margin-top: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .stats-card {
        margin-bottom: 20px;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card p {
        font-size: 0.85rem;
    }
    
    .module-card {
        margin-bottom: 20px;
    }
    
    .module-card .btn-module {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
        padding: 15px 20px;
        font-size: 1rem;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table td, .table th {
        padding: 8px 5px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .footer-custom {
        text-align: center;
    }
    
    .footer-custom .row {
        text-align: center;
    }
    
    .footer-custom h5 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .footer-custom p {
        font-size: 0.85rem;
    }
    
    .footer-custom ul {
        text-align: center;
        padding: 0;
    }
    
    .footer-custom ul li {
        display: block;
        margin: 5px 0;
    }
}

@media (max-width: 576px) {
    header {
        padding: 10px 15px;
    }
    
    .logo-container span {
        font-size: 16px;
    }
    
    .hero-section {
        padding: 30px 0;
    }
    
    .hero-section h1 {
        font-size: 1.3rem;
    }
    
    .hero-section p {
        font-size: 0.85rem;
    }
    
    .hero-section .col-md-4 {
        text-align: center !important;
        margin-top: 20px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    .stats-card {
        margin-bottom: 20px;
    }
    
    .stats-card h3 {
        font-size: 1.5rem;
    }
    
    .stats-card p {
        font-size: 0.85rem;
    }
    
    .stats-card .card-body {
        padding: 15px;
    }
    
    .stats-card .icon-wrapper {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    
    .module-card {
        margin-bottom: 20px;
    }
    
    .module-card .card-header {
        padding: 15px;
    }
    
    .module-card .card-header h5 {
        font-size: 1rem;
    }
    
    .module-card .card-body {
        padding: 20px;
    }
    
    .module-card .btn-module {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        text-align: center;
        padding: 15px 20px;
        font-size: 0.9rem;
    }
    
    .table-responsive {
        font-size: 0.8rem;
    }
    
    .table td, .table th {
        padding: 6px 3px;
    }
    
    .badge {
        font-size: 0.75rem;
        padding: 3px 6px;
    }
    
    .btn-sm {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    
    .footer-custom {
        padding: 30px 0 20px 0;
        text-align: center;
    }
    
    .footer-custom .row {
        text-align: center;
    }
    
    .footer-custom h5 {
        font-size: 1rem;
        margin-bottom: 10px;
    }
    
    .footer-custom p {
        font-size: 0.85rem;
    }
    
    .footer-custom ul {
        text-align: center;
        padding: 0;
    }
    
    .footer-custom ul li {
        display: block;
        margin: 5px 0;
    }
}

@media (max-width: 480px) {
    .logo-container {
        min-width: auto;
    }
    
    .logo-container img {
        height: 30px;
    }
    
    .logo-container span {
        font-size: 14px;
    }
    
    .hero-section {
        padding: 25px 0;
    }
    
    .hero-section h1 {
        font-size: 1.2rem;
    }
    
    .hero-section p {
        font-size: 0.8rem;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .stats-card .card-body {
        padding: 12px;
    }
    
    .stats-card h3 {
        font-size: 1.3rem;
    }
    
    .stats-card .icon-wrapper {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .module-card .card-header {
        padding: 12px;
    }
    
    .module-card .card-header h5 {
        font-size: 0.9rem;
    }
    
    .module-card .card-body {
        padding: 15px;
    }
    
    .module-card .btn-module {
        padding: 12px 15px;
        font-size: 0.85rem;
    }
    
    .table-responsive {
        font-size: 0.75rem;
    }
    
    .table td, .table th {
        padding: 5px 2px;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
    
    .btn-sm {
        padding: 4px 8px;
        font-size: 0.75rem;
    }
    
    .footer-custom {
        padding: 20px 0 15px 0;
    }
    
    .footer-custom h5 {
        font-size: 0.9rem;
    }
    
    .footer-custom p {
        font-size: 0.8rem;
    }
}

/* Styles pour le bouton de déconnexion amélioré */
.btn-logout {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 8px 20px !important;
    font-weight: 600 !important;
    font-size: 0.9rem !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 8px !important;
    position: relative !important;
    z-index: 1000 !important;
    min-height: 40px !important;
    cursor: pointer !important;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
    text-decoration: none !important;
}

.btn-logout:focus {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
    outline: none !important;
}

/* S'assurer que le bouton est visible dans la navigation */
.desktop-nav .btn-logout,
.mobile-nav .btn-logout {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 8px 16px !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    position: relative !important;
    z-index: 1000 !important;
    min-height: 36px !important;
    cursor: pointer !important;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3) !important;
    transition: all 0.3s ease !important;
}

.desktop-nav .btn-logout:hover,
.mobile-nav .btn-logout:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.4) !important;
    text-decoration: none !important;
}

/* Animation de pulsation pour attirer l'attention */
@keyframes pulse-logout {
    0% {
        box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 2px 12px rgba(220, 53, 69, 0.5);
    }
    100% {
        box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
    }
}

.desktop-nav .btn-logout,
.mobile-nav .btn-logout {
    animation: pulse-logout 3s infinite;
}

/* Arrêter l'animation au survol */
.desktop-nav .btn-logout:hover,
.mobile-nav .btn-logout:hover {
    animation: none;
}

.btn-logout i {
    font-size: 1rem !important;
}

/* Version mobile du bouton de déconnexion */
@media (max-width: 768px) {
    .btn-logout {
        padding: 12px 16px !important;
        font-size: 0.9rem !important;
        margin: 5px 0 !important;
        width: 100% !important;
        justify-content: center !important;
        display: inline-flex !important;
        min-height: 44px !important;
        border-radius: 8px !important;
    }

    .btn-logout:hover {
        transform: translateY(-1px) !important;
    }

    /* S'assurer que le bouton est visible dans le menu mobile */
    .mobile-nav .btn-logout {
        background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
        color: white !important;
        border: none !important;
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
        display: flex !important;
        width: 100% !important;
    }

    .mobile-nav .btn-logout:hover {
        background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
        box-shadow: 0 3px 10px rgba(220, 53, 69, 0.4) !important;
    }

    .mobile-nav .btn-logout i {
        margin-right: 8px !important;
        font-size: 1rem !important;
    }
}

/* Animation de pulsation pour attirer l'attention */
@keyframes pulse-logout {
    0% {
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
    50% {
        box-shadow: 0 2px 16px rgba(220, 53, 69, 0.5);
    }
    100% {
        box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
    }
}

.btn-logout {
    animation: pulse-logout 3s infinite;
}

/* Arrêter l'animation au survol */
.btn-logout:hover {
    animation: none;
}

/* Styles pour le bouton de déconnexion dans le dropdown */
.btn-logout-dropdown {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
    color: white !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    margin: 5px 8px !important;
    transition: all 0.3s ease !important;
    border: none !important;
    padding: 8px 12px !important;
    display: block !important;
    width: calc(100% - 16px) !important;
    text-align: left !important;
    position: relative !important;
    z-index: 1000 !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(220, 53, 69, 0.2) !important;
}

.btn-logout-dropdown:hover {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    color: white !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3) !important;
    text-decoration: none !important;
}

.btn-logout-dropdown:focus {
    background: linear-gradient(135deg, #c82333 0%, #bd2130 100%) !important;
    color: white !important;
    outline: none !important;
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3) !important;
}

.btn-logout-dropdown i {
    font-size: 0.9rem !important;
    margin-right: 8px !important;
}

/* ========================================
   RESPONSIVE DESIGN - Non-intrusif
   ======================================== */

/* Tablettes */
@media (max-width: 1024px) {
    .container {
        max-width: 95%;
    }

    .logo-container {
        min-width: 180px;
    }

    .logo-container span {
        font-size: 14px;
    }
}

/* Mobiles - Section déjà définie ci-dessus, ajustement uniquement */
@media (max-width: 768px) {
    header {
        padding: 8px 15px;
        min-height: 60px;
    }

    .logo-container {
        min-width: 160px;
    }

    .logo-container img {
        height: 32px;
        margin-right: 8px;
    }

    .logo-container span {
        font-size: 12px;
    }
    
    .desktop-nav {
        display: none;
    }
    
    .hamburger {
        display: block;
    }
    
    .mobile-nav.active {
        display: block;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: white;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
        z-index: 999;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .stats-card {
        margin-bottom: 20px;
    }
    
    .module-card {
        margin-bottom: 20px;
    }
    
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .footer-custom {
        text-align: center;
    }
}

/* Petits mobiles */
@media (max-width: 576px) {
    body {
        padding-top: 110px; /* 55px header + 55px banner */
    }

    header {
        padding: 6px 12px;
        min-height: 55px;
    }

    .logo-container {
        min-width: 140px;
    }

    .logo-container img {
        height: 28px;
        margin-right: 6px;
    }

    .logo-container span {
        font-size: 10.5px;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .stats-card h3 {
        font-size: 1.3rem;
    }
    
    .stats-card p {
        font-size: 0.8rem;
    }
    
    .table td, .table th {
        padding: 6px 3px;
    }
    
    .badge {
        font-size: 0.7rem;
        padding: 2px 4px;
    }
}

/* Très petits mobiles */
@media (max-width: 480px) {
    body {
        padding-top: 108px; /* 55px header + 53px banner */
    }

    .logo-container {
        min-width: 130px;
    }

    .logo-container img {
        height: 26px;
        margin-right: 5px;
    }

    .logo-container span {
        font-size: 9.5px;
    }

    .stats-card h3 {
        font-size: 1.2rem;
    }

    .table-responsive {
        font-size: 0.75rem;
    }

    /* Menu mobile optimisé pour petits écrans */
    .mobile-nav ul {
        padding: 10px !important;
        gap: 8px !important;
    }

    .mobile-nav ul li a {
        padding: 10px 12px !important;
        font-size: 0.9rem !important;
    }

    .mobile-nav .btn-logout {
        padding: 12px 15px !important;
        font-size: 0.9rem !important;
    }
}

/* Améliorations pour iPhone et appareils iOS */
@media (max-width: 768px) {
    /* Support des safe areas pour iPhone X et plus */
    body {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    header {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }

    .mobile-nav {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }

    /* Améliorer la zone de clic pour mobile */
    .hamburger {
        min-width: 44px !important;
        min-height: 44px !important;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    .mobile-nav ul li a,
    .mobile-nav .btn-logout {
        min-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
}

/* iPhone SE et petits iPhones */
@media (max-width: 375px) {
    body {
        padding-top: 100px; /* 50px header + 50px banner */
    }

    header {
        padding: 6px 8px;
        min-height: 50px;
    }

    .logo-container {
        min-width: 115px;
    }

    .logo-container img {
        height: 24px;
        margin-right: 5px;
    }

    .logo-container span {
        font-size: 8.5px;
        line-height: 1.2;
    }

    .mobile-nav.active {
        top: 50px;
        max-height: calc(100vh - 50px);
    }

    .mobile-nav ul {
        padding: 12px 10px;
        gap: 8px;
    }

    .mobile-nav ul li a {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    .btn-logout {
        padding: 10px 12px !important;
        font-size: 0.85rem !important;
    }
}

/* Orientation paysage sur mobile */
@media (max-width: 768px) and (orientation: landscape) {
    body {
        padding-top: 80px; /* 50px header + 30px banner */
    }

    header {
        padding: 5px 15px;
        min-height: 50px;
    }

    .logo-container {
        min-width: 140px;
    }

    .logo-container img {
        height: 28px;
        margin-right: 6px;
    }

    .logo-container span {
        font-size: 10px;
    }

    .banner {
        padding: 5px 10px;
        font-size: 0.75rem;
        top: 50px;
    }

    .mobile-nav.active {
        top: 50px;
        max-height: calc(100vh - 50px);
    }

    .mobile-nav ul {
        padding: 10px;
    }

    .mobile-nav ul li a {
        padding: 8px 10px;
    }
}
