/* ========================================
   RESPONSIVE - ADMIN INTERFACE
   ======================================== */

/* ========================================
   TABLETTE (max-width: 1024px)
   ======================================== */

@media (max-width: 1024px) {
    .admin-sidebar {
        width: 240px;
    }
    
    .admin-main {
        margin-left: 240px;
    }
    
    .admin-header h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .table-header {
        flex-wrap: wrap;
    }
    
    .search-box input {
        width: 200px;
    }
}

/* ========================================
   TABLETTE PORTRAIT (max-width: 768px)
   ======================================== */

@media (max-width: 768px) {
    /* Sidebar minimisée */
    .admin-sidebar {
        width: 70px;
        transition: width 0.3s ease;
    }
    
    .admin-sidebar:hover {
        width: 240px;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.2);
    }
    
    .admin-main {
        margin-left: 70px;
    }
    
    /* Cacher les textes de la sidebar */
    .sidebar-header p,
    .nav-item span:not(.icon),
    .nav-section {
        display: none;
    }
    
    .admin-sidebar:hover .sidebar-header p,
    .admin-sidebar:hover .nav-item span:not(.icon),
    .admin-sidebar:hover .nav-section {
        display: block;
    }
    
    .sidebar-header h2 {
        font-size: 0;
    }
    
    .admin-sidebar:hover .sidebar-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-item {
        justify-content: center;
    }
    
    .admin-sidebar:hover .nav-item {
        justify-content: flex-start;
    }
    
    .btn-back {
        padding: 0.75rem 0;
    }
    
    .admin-sidebar:hover .btn-back {
        padding: 0.75rem;
    }
    
    /* Header */
    .admin-header {
        padding: 1rem;
    }
    
    .admin-header h1 {
        font-size: 1.25rem;
    }
    
    .btn-logout {
        padding: 0.4rem 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Stats */
    .stats-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .stat-card {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .stat-card .stat-icon {
        order: 2;
    }
    
    /* Table */
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }
    
    .table-actions {
        flex-direction: column;
    }
    
    .search-box input {
        width: 100%;
    }
    
    .data-table {
        font-size: 0.85rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.75rem;
    }
    
    /* Cacher certaines colonnes sur tablette */
    .data-table th:nth-child(3),
    .data-table td:nth-child(3),
    .data-table th:nth-child(5),
    .data-table td:nth-child(5) {
        display: none;
    }
    
    /* Modal */
    .modal-dialog {
        max-width: 90%;
        margin: 1rem auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   MOBILE (max-width: 480px)
   ======================================== */

@media (max-width: 480px) {
    /* Sidebar toujours cachée */
    .admin-sidebar {
        position: fixed;
        left: -240px;
        width: 240px;
        z-index: 10000;
        transition: left 0.3s ease;
    }
    
    .admin-sidebar.open {
        left: 0;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.3);
    }
    
    /* Afficher tous les textes sur mobile quand ouvert */
    .admin-sidebar .sidebar-header p,
    .admin-sidebar .nav-item span:not(.icon),
    .admin-sidebar .nav-section {
        display: block;
    }
    
    .sidebar-header h2 {
        font-size: 1.5rem;
    }
    
    .nav-item {
        justify-content: flex-start;
    }
    
    .btn-back {
        padding: 0.75rem;
    }
    
    /* Main content prend toute la largeur */
    .admin-main {
        margin-left: 0;
        width: 100%;
    }
    
    /* Bouton menu burger */
    .admin-header::before {
        content: '☰';
        font-size: 1.5rem;
        cursor: pointer;
        margin-right: 1rem;
        padding: 0.5rem;
        border-radius: 4px;
        transition: background 0.2s ease;
    }
    
    .admin-header::before:hover {
        background: #f1f5f9;
    }
    
    /* Header */
    .admin-header {
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
    }
    
    .admin-header h1 {
        font-size: 1.1rem;
        flex: 1;
    }
    
    /* Bouton déconnexion responsive */
    .btn-logout {
        padding: 0.5rem 1rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
        gap: 0.35rem !important;
    }
    
    .btn-logout::before {
        font-size: 0.95rem !important;
    }
    
    /* Content */
    .admin-content {
        padding: 1rem;
    }
    
    /* Stats */
    .stat-card {
        padding: 1rem;
    }
    
    .stat-card .stat-value {
        font-size: 1.5rem;
    }
    
    /* Table responsive */
    .data-table-container {
        overflow-x: auto;
    }
    
    /* Affichage en cartes pour mobile */
    .data-table thead {
        display: none;
    }
    
    .data-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 2px solid #e0e8f0;
        border-radius: 8px;
        padding: 1rem;
    }
    
    .data-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
    }
    
    .data-table tbody td:last-child {
        border-bottom: none;
    }
    
    .data-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
    }
    
    .data-table tbody td code {
        font-size: 0.75rem;
    }
    
    /* Badges plus petits */
    .badge {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
    }
    
    /* Boutons actions */
    .btn-icon {
        font-size: 1rem;
        padding: 0.25rem;
    }
    
    /* Modal full width sur mobile */
    .modal-overlay {
        padding: 0;
    }
    
    .modal-dialog {
        max-width: 100%;
        min-height: 100vh;
        margin: 0;
        border-radius: 0;
        max-height: 100vh;
    }
    
    .modal-header {
        padding: 1rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
    }
    
    .modal-header h2 {
        font-size: 1.25rem;
    }
    
    .modal-dialog form {
        padding: 1rem;
        overflow-y: auto;
    }
    
    .form-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    
    .form-group label {
        font-size: 0.9rem;
    }
    
    .form-group input,
    .form-group select {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    .modal-footer {
        padding: 1rem;
        position: sticky;
        bottom: 0;
        background: #f8fafc;
        z-index: 10;
        flex-direction: row;
        gap: 0.75rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.875rem 1.25rem;
        font-size: 1rem;
        flex: 1;
        border-radius: 10px;
    }
    
    /* Import info */
    .import-info {
        padding: 1rem;
        font-size: 0.85rem;
    }
    
    .import-info code {
        font-size: 0.75rem;
        word-wrap: break-word;
        white-space: pre-wrap;
    }
}

/* ========================================
   OVERLAY POUR FERMER LA SIDEBAR MOBILE
   ======================================== */

@media (max-width: 480px) {
    /* Overlay quand sidebar ouverte */
    body::after {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    body.sidebar-open::after {
        opacity: 1;
        pointer-events: all;
    }
}

/* ========================================
   DASHBOARD USER RESPONSIVE
   ======================================== */

/* Desktop - Cacher le bouton hamburger et overlay */
.menu-toggle,
.menu-overlay {
    display: none;
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
        padding: 1rem;
    }

    .main-nav {
        flex-wrap: wrap;
        width: 100%;
    }

    .user-menu {
        width: 100%;
        justify-content: space-between;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e0e8f0;
    }
    
    .user-info {
        flex-direction: row;
        align-items: center;
    }
    
    .user-avatar,
    .user-avatar-initials {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .profile-menu {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid #e0e8f0;
    }
    
    .profile-toggle {
        width: 56px;
        height: 56px;
    }
    
    .profile-dropdown {
        right: 50%;
        transform: translateX(50%) translateY(-10px);
        min-width: 90vw;
        max-width: 320px;
        display: none !important;
    }
    
    .profile-dropdown.active {
        transform: translateX(50%) translateY(0);
        display: block !important;
    }

    .dashboard-main {
        padding: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .welcome-section {
        padding: 2rem 1.5rem;
    }
    
    .welcome-section h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    /* Header compact */
    .dashboard-header {
        position: relative;
    }
    
    .header-content {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 1rem;
    }
    
    .logo h1 {
        font-size: 1.25rem;
    }
    
    /* Menu hamburger */
    .menu-toggle {
        display: block;
        background: none;
        border: none;
        font-size: 1.75rem;
        cursor: pointer;
        padding: 0.5rem;
        color: #1e293b;
        z-index: 1001;
        transition: transform 0.3s ease;
    }
    
    .menu-toggle:active {
        transform: scale(0.9);
    }
    
    /* Menu caché par défaut */
    .main-nav {
        position: fixed;
        top: 0;
        right: -100%;
        width: 280px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 5rem 1.5rem 1.5rem 1.5rem;
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
    }
    
    .main-nav.open {
        right: 0;
    }
    
    /* Liens du menu */
    .nav-link {
        padding: 1rem;
        font-size: 1rem;
        width: 100%;
        text-align: left;
        border-radius: 12px;
        margin-bottom: 0.5rem;
        transition: all 0.2s ease;
    }
    
    .nav-link:hover {
        background: #f1f5f9;
        transform: translateX(5px);
    }
    
    /* User menu dans le drawer */
    .user-menu {
        width: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
        margin-top: auto;
        padding-top: 1.5rem;
        border-top: 2px solid #e0e8f0;
    }
    
    .user-info {
        text-align: center;
        padding: 1rem;
        background: #f8fafc;
        border-radius: 12px;
    }
    
    .user-name {
        font-size: 1rem;
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .user-role {
        font-size: 0.85rem;
        display: block;
    }
    
    .btn-logout {
        padding: 0.875rem;
        font-size: 1rem;
        width: 100%;
        justify-content: center;
        border-radius: 12px;
    }
    
    /* Overlay sombre */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
    }
    
    .menu-overlay.active {
        opacity: 1;
        pointer-events: all;
    }
    
    /* Contenu principal */
    .dashboard-main {
        padding: 1rem;
    }
    
    .dashboard-card {
        padding: 1.5rem;
    }
    
    .card-icon {
        font-size: 2rem;
    }
    
    .dashboard-card h4 {
        font-size: 1.1rem;
    }
    
    /* Input file pour mobile */
    .form-group input[type="file"] {
        padding: 0.75rem;
        font-size: 1rem;
    }
    
    /* Prévisualisation d'image réduite sur mobile */
    #preview-img {
        max-height: 150px !important;
    }
    
    /* Textarea réduite sur mobile */
    .form-group textarea {
        min-height: 100px !important;
    }
}

/* ========================================
   PAGE ACTUALITÉS - HOME RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    /* Hero section */
    .news-hero h2 {
        font-size: 1.75rem;
    }
    
    .news-hero {
        padding: 2rem 1.5rem;
    }

    /* Grille des actualités */
    .news-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    /* Images des cartes */
    .news-image-wrapper {
        height: 200px;
    }
    
    /* Contenu des cartes */
    .news-content {
        padding: 1.25rem;
    }
    
    .news-title {
        font-size: 1.2rem;
    }
    
    /* Modal */
    .news-modal {
        padding: 1rem;
    }
    
    .modal-header {
        height: 250px;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .modal-title {
        font-size: 1.5rem;
    }
    
    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
    }
    
    .modal-content-text {
        font-size: 1rem;
    }
    
    /* Images dans le contenu */
    .modal-content-text img {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Hero section mobile */
    .news-hero h2 {
        font-size: 1.5rem;
    }
    
    .news-hero p {
        font-size: 1rem;
    }
    
    .news-hero {
        padding: 1.5rem 1rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }
    
    /* Grille des actualités */
    .news-grid {
        gap: 1.25rem;
    }
    
    /* Cartes d'actualités */
    .news-card {
        border-radius: 12px;
    }
    
    .news-image-wrapper {
        height: 180px;
    }
    
    .news-content {
        padding: 1rem;
    }
    
    .news-category {
        font-size: 0.8rem;
        padding: 0.2rem 0.6rem;
    }
    
    .news-title {
        font-size: 1.1rem;
        margin-bottom: 0.75rem;
    }
    
    .news-excerpt {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 1rem;
    }
    
    .news-meta {
        font-size: 0.85rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .read-more {
        font-size: 0.9rem;
        margin-top: 0.25rem;
    }
    
    /* Badge important */
    .badge-important {
        font-size: 0.8rem;
        padding: 0.35rem 0.85rem;
        top: 0.75rem;
        right: 0.75rem;
    }
    
    /* Bannière mobile */
    .news-banner {
        font-size: 0.75rem;
        padding: 0.4rem 0.75rem;
        top: 0.5rem;
        left: 0.5rem;
    }
    
    /* Modal full screen mobile */
    .news-modal {
        padding: 0;
    }
    
    .news-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
        margin: 0;
    }
    
    .modal-header {
        height: 60px;
    }
    
    .modal-close {
        width: 36px;
        height: 36px;
        font-size: 1.25rem;
    }
    
    .modal-badge-important {
        font-size: 0.85rem;
        padding: 0.4rem 1rem;
    }
    
    .modal-body {
        padding: 1.25rem;
    }
    
    .modal-title {
        font-size: 1.35rem;
        line-height: 1.3;
    }
    
    .modal-subtitle {
        font-size: 1.1rem;
        margin: -0.25rem 0 1.25rem 0;
    }
    
    .modal-meta {
        flex-direction: column;
        gap: 0.5rem;
        align-items: flex-start;
        padding: 0.75rem 0;
        margin-bottom: 1.5rem;
    }
    
    .modal-meta-item {
        font-size: 0.9rem;
    }
    
    .modal-content-text {
        font-size: 0.95rem;
        line-height: 1.7;
    }
    
    .modal-content-text h1 {
        font-size: 1.5rem;
    }
    
    .modal-content-text h2 {
        font-size: 1.3rem;
    }
    
    .modal-content-text h3 {
        font-size: 1.15rem;
    }
    
    .modal-content-text img {
        margin: 0.75rem 0;
        border-radius: 6px;
        width: 100%;
    }
    
    .modal-link-external {
        font-size: 0.95rem;
        padding: 0.65rem 1.25rem;
        margin-top: 1.5rem;
    }
    
    /* Message vide */
    .empty-news {
        padding: 3rem 1.5rem;
    }
    
    .empty-news-icon {
        font-size: 4rem;
    }
    
    .empty-news h3 {
        font-size: 1.25rem;
    }
    
    .empty-news p {
        font-size: 0.95rem;
    }
}

/* ========================================
   ORGANIGRAMME - RESPONSIVE
   ======================================== */

/* Tablette */
@media (max-width: 768px) {
    .organigramme-container {
        padding: 1rem;
    }

    .page-header {
        padding: 1.25rem;
    }

    .page-header h1 {
        font-size: 1.75rem;
        gap: 1rem;
    }

    .org-icon {
        width: 36px;
        height: 36px;
    }

    .org-icon svg {
        width: 20px;
        height: 20px;
    }

    .search-container {
        max-width: 100%;
    }

    .search-input {
        font-size: 0.95rem;
        padding: 0.75rem 3rem 0.75rem 1rem;
    }

    .filter-btn {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }

    .children-row {
        gap: 1.5rem;
    }

    .employee-card {
        min-width: 180px;
        max-width: 250px;
        padding: 1.25rem;
    }

    .employee-name {
        font-size: 1rem;
    }

    .employee-poste {
        font-size: 0.85rem;
    }

    .employee-departement {
        font-size: 0.8rem;
        padding: 0.3rem 0.75rem;
    }

    .subordinates-count {
        top: -12px;
        left: -12px;
        font-size: 0.8rem;
        padding: 0.3rem 0.6rem;
        min-width: 28px;
    }

    .employee-card.manager::before {
        font-size: 1.5rem;
        top: -10px;
        right: -10px;
    }

    .expand-indicator {
        width: 32px;
        height: 32px;
        bottom: -16px;
        font-size: 0.85rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .organigramme-container {
        padding: 0.5rem;
    }

    .page-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
        background: rgba(255, 255, 255, 0.98) !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Repositionner les notifications à droite sur mobile */
    .notifications-widget {
        position: absolute !important;
        top: 1rem;
        right: 1rem;
        z-index: 100000 !important;
    }
    
    .btn-notifications {
        width: 40px !important;
        height: 40px !important;
        z-index: 100000 !important;
    }
    
    .notif-count {
        top: -3px !important;
        right: -3px !important;
        font-size: 0.7rem !important;
        padding: 0.15rem 0.35rem !important;
        z-index: 100001 !important;
    }
    
    .notifications-dropdown {
        position: fixed !important;
        top: 60px !important;
        right: 0.5rem !important;
        left: 0.5rem !important;
        width: auto !important;
        max-width: none !important;
        z-index: 999999 !important;
    }

    .page-header h1 {
        font-size: 1.5rem;
        gap: 0.75rem;
    }

    .org-icon {
        width: 32px;
        height: 32px;
    }

    .org-icon svg {
        width: 18px;
        height: 18px;
    }

    .search-container {
        margin-bottom: 1rem;
        width: 100%;
        max-width: 100%;
    }

    .search-input {
        font-size: 0.9rem;
        padding: 0.85rem 2.5rem 0.85rem 1rem;
        width: 100%;
        border-radius: 12px;
    }

    .btn-clear-search {
        width: 28px;
        height: 28px;
        font-size: 0.9rem;
    }

    .filters {
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
        margin-top: 0.75rem;
        width: 100%;
    }

    .filter-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* Organigramme en mode liste verticale sur mobile */
    .org-chart {
        padding: 0.5rem;
        overflow: visible !important;
        position: relative !important;
        z-index: 1 !important;
    }

    .org-node {
        padding: 0;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Cacher les lignes de connexion sur mobile */
    .connection-line {
        display: none !important;
    }

    .children-row {
        display: flex;
        flex-direction: column;
        gap: 0.75rem;
        padding-left: 0;
        border-left: none;
        margin-left: 0;
        margin-top: 0.75rem;
        overflow: visible;
    }

    .employee-card {
        width: 100%;
        min-width: auto;
        max-width: none;
        padding: 1rem;
        flex-shrink: 0;
        margin: 0;
        position: relative;
    }
    
    /* Cacher le compteur de subordinés positionné en absolu */
    .subordinates-count {
        display: none !important;
    }
    
    /* Indicateur de subordination - design moderne et élégant */
    .expand-indicator {
        position: absolute !important;
        bottom: -12px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 26px !important;
        height: 26px !important;
        padding: 0 !important;
        margin: 0 !important;
        border-radius: 50% !important;
        background: #ffffff !important;
        color: #2c5f8d !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        border: none !important;
        cursor: pointer !important;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12), 
                    0 0 0 0 rgba(44, 95, 141, 0) !important;
        z-index: 10 !important;
        top: auto !important;
        right: auto !important;
    }
    
    .expand-indicator:hover {
        background: #2c5f8d !important;
        color: white !important;
        transform: translateX(-50%) scale(1.15) !important;
        box-shadow: 0 4px 12px rgba(44, 95, 141, 0.25),
                    0 0 0 3px rgba(44, 95, 141, 0.1) !important;
    }
    
    .expand-indicator:active {
        transform: translateX(-50%) scale(0.9) !important;
    }
    
    .expand-indicator::before {
        content: '' !important;
        margin: 0 !important;
        display: none !important;
    }
    
    .expand-indicator.collapsed::before {
        content: '' !important;
    }

    .employee-name {
        font-size: 0.95rem;
        margin-bottom: 0.3rem;
    }

    .employee-poste {
        font-size: 0.8rem;
        margin-bottom: 0.3rem;
    }

    .employee-departement {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-top: 0.3rem;
        display: inline-block;
    }

    .subordinates-count {
        position: static !important;
        display: inline-block;
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
        margin-top: 0.5rem;
        margin-left: 0.5rem;
        min-width: auto;
        border-width: 2px;
    }

    .employee-card.manager::before {
        display: none;
    }
    
    /* Organisation enfants en mode empilé */
    .org-children {
        margin-top: 0.5rem;
        margin-left: 0;
    }
}

/* ========================================
   PAGE LOGS D'ACTIVITÉ - RESPONSIVE
   ======================================== */

/* Par défaut (desktop) - Cacher le bouton toggle */
.btn-toggle-filters {
    display: none;
}

.filters-container {
    display: grid;
}

/* Tablette */
@media (max-width: 768px) {
    /* Filtres en colonne sur tablette */
    .filters-container {
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filters-container button {
        grid-column: span 2;
    }
    
    /* Header avec bouton export */
    .admin-header {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .admin-header .btn {
        width: 100%;
        justify-content: center;
    }
    
    /* Table des logs - Cacher colonnes IP et détails sur tablette */
    #logsTable th:nth-child(4),
    #logsTable td:nth-child(4),
    #logsTable th:nth-child(5),
    #logsTable td:nth-child(5) {
        display: none;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Bouton toggle filtres */
    .btn-toggle-filters {
        display: inline-flex;
        align-items: center;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
        font-size: 0.95rem;
        border-radius: 10px;
        transition: all 0.3s ease;
    }
    
    .btn-toggle-filters.active {
        background: #3b82f6;
        color: white;
    }
    
    .btn-toggle-filters .filter-icon {
        font-size: 1.1rem;
    }
    
    /* Header actions en ligne */
    .header-actions {
        display: flex;
        gap: 0.5rem;
        flex-wrap: wrap;
        width: 100%;
        margin-top: 0.75rem;
    }
    
    .header-actions .btn {
        flex: 1;
        min-width: 120px;
    }
    
    /* Filtres cachés par défaut sur mobile */
    .filters-container {
        display: none;
        flex-direction: column;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
        padding: 1rem;
        background: #f8fafc;
        border-radius: 12px;
        border: 2px solid #e0e8f0;
        animation: slideDown 0.3s ease;
    }
    
    .filters-container.show {
        display: flex;
    }
    
    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .filter-group {
        width: 100%;
    }
    
    .filter-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
        display: block;
        font-weight: 600;
        color: #475569;
    }
    
    .filter-group select,
    .filter-group input {
        width: 100%;
        padding: 0.75rem;
        font-size: 1rem;
        border: 2px solid #e0e8f0;
        border-radius: 8px;
    }
    
    .filters-container .btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
        margin-top: 0.25rem;
    }
    
    /* Header logs mobile */
    .admin-header h1 {
        font-size: 1.1rem;
        margin-bottom: 0.5rem;
    }
    
    .admin-header .btn-secondary {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    /* Table en mode carte pour mobile */
    #logsTable {
        border: none;
    }
    
    #logsTable thead {
        display: none;
    }
    
    #logsTable tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 2px solid #e0e8f0;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    #logsTable tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }
    
    #logsTable tbody td:last-child {
        border-bottom: none;
    }
    
    #logsTable tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
        text-align: left;
        flex: 0 0 40%;
    }
    
    /* Ajouter les data-labels via JS ou inline */
    #logsTable tbody tr td:nth-child(1)::before {
        content: 'Date & Heure';
    }
    
    #logsTable tbody tr td:nth-child(2)::before {
        content: 'Utilisateur';
    }
    
    #logsTable tbody tr td:nth-child(3)::before {
        content: 'Action';
    }
    
    #logsTable tbody tr td:nth-child(4)::before {
        content: 'Détails';
    }
    
    #logsTable tbody tr td:nth-child(5)::before {
        content: 'IP';
    }
    
    /* Badges dans les cartes */
    .badge {
        font-size: 0.75rem;
        padding: 0.3rem 0.75rem;
        border-radius: 6px;
        white-space: nowrap;
    }
    
    /* Pagination mobile */
    .pagination {
        flex-direction: column;
        gap: 0.75rem;
        padding: 1rem 0;
    }
    
    .pagination .btn {
        width: 100%;
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    .pagination .page-info {
        font-size: 0.95rem;
        padding: 0.5rem;
        text-align: center;
        color: #64748b;
        font-weight: 500;
    }
    
    /* Conteneur de table avec scroll horizontal si nécessaire */
    .table-container {
        overflow-x: visible;
        margin: 0;
        padding: 0;
    }
    
    /* Ajuster le spacing du contenu principal */
    .admin-main {
        padding: 0.5rem;
    }
}

/* ========================================
   CALENDRIER - RESPONSIVE
   ======================================== */

/* Tablette - Calendrier */
@media (max-width: 768px) {
    /* Cacher certaines colonnes du tableau calendrier */
    #calendar-events-tbody tr td:nth-child(4) {
        display: none; /* Lieu */
    }
    
    /* Adapter les filtres */
    .section-header {
        flex-direction: column;
        align-items: stretch !important;
        gap: 1rem;
    }
    
    .section-header .btn-primary {
        width: 100%;
        justify-content: center;
    }
}

/* Mobile - Calendrier */
@media (max-width: 480px) {
    /* Stats calendrier en format compact mobile */
    .stats-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }
    
    .stat-card {
        padding: 0.75rem !important;
        border-radius: 8px !important;
    }
    
    .stat-card > div {
        gap: 0.5rem !important;
    }
    
    .stat-card .stat-icon,
    .stat-card > div > div:first-child {
        font-size: 1.5rem !important;
    }
    
    .stat-card > div > div:last-child > div:first-child {
        font-size: 0.7rem !important;
    }
    
    .stat-card > div > div:last-child > div:last-child {
        font-size: 1.25rem !important;
    }
    
    /* Stats admin - version badges compacts sur mobile (toutes les pages) */
    @media (max-width: 480px) {
        .stats-grid-news,
        .stats-grid-calendar,
        .stats-grid-documents,
        .stats-grid-media,
        .stats-grid-dashboard,
        .stats-grid-users,
        .stats-grid-sms {
            display: grid !important;
            grid-template-columns: repeat(2, 1fr) !important;
            gap: 0.5rem !important;
            margin-bottom: 1.5rem !important;
        }
        
        .stats-grid-news .stat-card,
        .stats-grid-calendar .stat-card,
        .stats-grid-documents .stat-card,
        .stats-grid-media .stat-card,
        .stats-grid-dashboard .stat-card,
        .stats-grid-users .stat-card,
        .stats-grid-sms .stat-card {
            padding: 0.75rem 0.5rem !important;
            border-radius: 12px !important;
            color: white !important;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15) !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
        }
        
        .stats-grid-news .stat-card > div,
        .stats-grid-calendar .stat-card > div,
        .stats-grid-documents .stat-card > div,
        .stats-grid-media .stat-card > div,
        .stats-grid-dashboard .stat-card > div,
        .stats-grid-users .stat-card > div,
        .stats-grid-sms .stat-card > div {
            display: flex !important;
            flex-direction: column !important;
            gap: 0.3rem !important;
            align-items: center !important;
            text-align: center !important;
        }
        
        .stats-grid-news .stat-card > div > div:first-child,
        .stats-grid-calendar .stat-card > div > div:first-child,
        .stats-grid-documents .stat-card > div > div:first-child,
        .stats-grid-media .stat-card > div > div:first-child,
        .stats-grid-dashboard .stat-card > div > div:first-child,
        .stats-grid-users .stat-card > div > div:first-child,
        .stats-grid-sms .stat-card > div > div:first-child {
            font-size: 1.8rem !important;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:first-child,
        .stats-grid-calendar .stat-card > div > div:last-child > div:first-child,
        .stats-grid-documents .stat-card > div > div:last-child > div:first-child,
        .stats-grid-media .stat-card > div > div:last-child > div:first-child,
        .stats-grid-dashboard .stat-card > div > div:last-child > div:first-child,
        .stats-grid-users .stat-card > div > div:last-child > div:first-child,
        .stats-grid-sms .stat-card > div > div:last-child > div:first-child {
            font-size: 0.7rem !important;
            opacity: 0.95 !important;
            margin-bottom: 0.15rem !important;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-calendar .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-documents .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-media .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-dashboard .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-users .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-sms .stat-card > div > div:last-child > div:nth-child(2) {
            font-size: 1.5rem !important;
            font-weight: 700 !important;
            line-height: 1 !important;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-calendar .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-documents .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-media .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-dashboard .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-users .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-sms .stat-card > div > div:last-child > div:nth-child(3) {
            font-size: 0.6rem !important;
            opacity: 0.85 !important;
        }
        
        .stat-card-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%) !important; }
        .stat-card-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important; }
        .stat-card-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important; }
        .stat-card-gray { background: linear-gradient(135deg, #64748b 0%, #475569 100%) !important; }
        .stat-card-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important; }
        .stat-card-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%) !important; }
        .stat-card-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important; }
        .stat-card-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%) !important; }
        .stat-card-cyan { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%) !important; }
        .stat-card-pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important; }
        
        /* Media page mobile */
        .media-grid {
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
            gap: 1rem !important;
        }
        .media-thumbnail, .file-icon {
            height: 150px !important;
        }
        .tabs {
            overflow-x: auto !important;
            -webkit-overflow-scrolling: touch !important;
        }
        .tab {
            white-space: nowrap !important;
            flex-shrink: 0 !important;
            padding: 0.5rem 1rem !important;
            font-size: 0.85rem !important;
        }
        #drop-zone {
            padding: 1rem !important;
        }
        #drop-zone > div:first-child {
            font-size: 1.5rem !important;
        }
        .media-card {
            border-radius: 8px !important;
        }
        .media-actions {
            gap: 0.25rem !important;
        }
        .btn-view, .btn-delete-media {
            font-size: 0.8rem !important;
            padding: 0.4rem !important;
        }
    }
    
    /* Desktop - garder le style original (toutes les pages) */
    @media (min-width: 481px) {
        .stats-grid-news,
        .stats-grid-calendar,
        .stats-grid-documents,
        .stats-grid-media,
        .stats-grid-dashboard,
        .stats-grid-users {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .stats-grid-news .stat-card,
        .stats-grid-calendar .stat-card,
        .stats-grid-documents .stat-card,
        .stats-grid-media .stat-card,
        .stats-grid-dashboard .stat-card,
        .stats-grid-users .stat-card,
        .stats-grid-sms .stat-card {
            padding: 1.5rem;
            border-radius: 12px;
            color: white;
        }
        
        .stats-grid-news .stat-card > div,
        .stats-grid-calendar .stat-card > div,
        .stats-grid-documents .stat-card > div,
        .stats-grid-media .stat-card > div,
        .stats-grid-dashboard .stat-card > div,
        .stats-grid-users .stat-card > div,
        .stats-grid-sms .stat-card > div {
            display: flex;
            align-items: center;
            gap: 1rem;
        }
        
        .stats-grid-news .stat-card > div > div:first-child,
        .stats-grid-calendar .stat-card > div > div:first-child,
        .stats-grid-documents .stat-card > div > div:first-child,
        .stats-grid-media .stat-card > div > div:first-child,
        .stats-grid-dashboard .stat-card > div > div:first-child,
        .stats-grid-users .stat-card > div > div:first-child,
        .stats-grid-sms .stat-card > div > div:first-child {
            font-size: 2.5rem;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:first-child,
        .stats-grid-calendar .stat-card > div > div:last-child > div:first-child,
        .stats-grid-documents .stat-card > div > div:last-child > div:first-child,
        .stats-grid-media .stat-card > div > div:last-child > div:first-child,
        .stats-grid-dashboard .stat-card > div > div:last-child > div:first-child,
        .stats-grid-users .stat-card > div > div:last-child > div:first-child,
        .stats-grid-sms .stat-card > div > div:last-child > div:first-child {
            font-size: 0.85rem;
            opacity: 0.9;
            margin-bottom: 0.25rem;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-calendar .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-documents .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-media .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-dashboard .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-users .stat-card > div > div:last-child > div:nth-child(2),
        .stats-grid-sms .stat-card > div > div:last-child > div:nth-child(2) {
            font-size: 2rem;
            font-weight: 700;
        }
        
        .stats-grid-news .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-calendar .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-documents .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-media .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-dashboard .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-users .stat-card > div > div:last-child > div:nth-child(3),
        .stats-grid-sms .stat-card > div > div:last-child > div:nth-child(3) {
            font-size: 0.75rem;
            opacity: 0.8;
            margin-top: 0.25rem;
        }
        
        .stat-card-blue { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3); }
        .stat-card-green { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); }
        .stat-card-orange { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3); }
        .stat-card-gray { background: linear-gradient(135deg, #64748b 0%, #475569 100%); box-shadow: 0 4px 12px rgba(100, 116, 139, 0.3); }
        .stat-card-red { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3); }
        .stat-card-purple { background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%); box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3); }
        .stat-card-indigo { background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%); box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
        .stat-card-teal { background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%); box-shadow: 0 4px 12px rgba(20, 184, 166, 0.3); }
        .stat-card-cyan { background: linear-gradient(135deg, #06b6d4 0%, #0891b2 100%); box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3); }
        .stat-card-pink { background: linear-gradient(135deg, #ec4899 0%, #db2777 100%); box-shadow: 0 4px 12px rgba(236, 72, 153, 0.3); }
    }
    
    /* Table calendrier en mode carte */
    #calendar-events-tbody {
        display: block;
    }
    
    #calendar-events-tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: white;
        border: 2px solid #e0e8f0;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }
    
    #calendar-events-tbody td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding: 0.75rem 0;
        border: none;
        border-bottom: 1px solid #f1f5f9;
        text-align: right;
    }
    
    #calendar-events-tbody td:last-child {
        border-bottom: none;
        padding-top: 1rem;
        justify-content: center;
    }
    
    #calendar-events-tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #64748b;
        font-size: 0.85rem;
        text-align: left;
        flex: 0 0 40%;
    }
    
    /* Cacher l'en-tête */
    .data-table-container table thead {
        display: none;
    }
    
    /* Header section responsive */
    .section-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.25rem !important;
    }
    
    /* Filtres calendrier en colonne */
    .section-header + div {
        flex-direction: column !important;
    }
    
    .section-header + div select,
    .section-header + div .search-box {
        width: 100%;
    }
    
    /* Boutons actions calendrier */
    .action-buttons {
        display: flex;
        gap: 0.5rem;
        width: 100%;
        justify-content: center;
    }
    
    .action-buttons .btn-icon {
        flex: 1;
        padding: 0.75rem;
        font-size: 1.25rem;
    }
    
    /* Modal calendrier responsive */
    #eventModal .modal-dialog {
        max-width: 95%;
        margin: 0.5rem;
    }
    
    #eventModal .form-grid {
        grid-template-columns: 1fr !important;
    }
    
    #eventModal .form-group {
        grid-column: 1 / -1 !important;
    }
    
    /* ========================================
       CALENDRIER UTILISATEUR - MOBILE
       ======================================== */
    
    /* Container calendrier */
    .calendar-container {
        padding: 1rem !important;
    }
    
    /* Header du calendrier */
    .calendar-header {
        flex-direction: column;
        padding: 1rem !important;
        gap: 0.75rem;
        border-radius: 16px !important;
        margin-bottom: 1.5rem !important;
    }
    
    .calendar-nav {
        flex-direction: column;
        width: 100%;
        gap: 0.5rem !important;
    }
    
    .calendar-nav button {
        padding: 0.5rem 0.875rem !important;
        font-size: 0.85rem !important;
        border-radius: 10px !important;
    }
    
    .calendar-nav h2 {
        font-size: 1.25rem !important;
        min-width: auto !important;
        margin: 0.25rem 0 !important;
    }
    
    .view-toggle {
        width: 100%;
        justify-content: stretch;
        padding: 0.35rem !important;
        border-radius: 10px !important;
    }
    
    .view-toggle button {
        flex: 1;
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    
    /* Grille calendrier - Réduire les cellules */
    .calendar-grid {
        gap: 0 !important;
        border-radius: 8px !important;
    }
    
    .calendar-day-header {
        padding: 0.5rem 0.25rem !important;
        font-size: 0.7rem !important;
    }
    
    .calendar-day {
        min-height: 80px !important;
        padding: 0.4rem !important;
    }
    
    .calendar-day.today {
        border: 2px solid #f59e0b !important;
    }
    
    .day-number {
        font-size: 0.9rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .event-item {
        padding: 0.25rem 0.35rem !important;
        margin: 0.2rem 0 !important;
        font-size: 0.65rem !important;
        border-radius: 4px !important;
    }
    
    .event-item:hover {
        transform: none !important;
    }
    
    /* Liste des événements */
    .events-list {
        padding: 1rem !important;
        border-radius: 8px !important;
    }
    
    .events-list h3 {
        font-size: 1.1rem !important;
    }
    
    .event-card {
        padding: 0.75rem !important;
        margin: 0.5rem 0 !important;
        border-radius: 6px !important;
    }
    
    .event-card:hover {
        transform: none !important;
    }
    
    .event-card-title {
        font-size: 0.95rem !important;
        margin-bottom: 0.4rem !important;
    }
    
    .event-card-meta {
        font-size: 0.8rem !important;
        gap: 0.5rem !important;
    }
    
    /* Modal événement */
    .event-modal-content {
        width: 95% !important;
        border-radius: 12px !important;
    }
    
    .event-modal-header {
        padding: 1rem !important;
        border-radius: 12px 12px 0 0 !important;
    }
    
    .event-modal-header h2 {
        font-size: 1.1rem !important;
        padding-right: 2.5rem;
    }
    
    .modal-close {
        width: 35px !important;
        height: 35px !important;
        font-size: 1.25rem !important;
    }
    
    .event-modal-body {
        padding: 1.25rem !important;
    }
    
    .modal-section {
        margin-bottom: 1rem !important;
    }
    
    .modal-section-title {
        font-size: 0.75rem !important;
    }
    
    .modal-section-content {
        font-size: 0.9rem !important;
    }
}

/* ========================================
   RESPONSIVE - TROMBINOSCOPE
   ======================================== */

/* Tablette */
@media (max-width: 768px) {
    .trombinoscope-container {
        padding: 1.5rem !important;
    }
    
    .trombinoscope-header {
        padding: 1.5rem !important;
        margin-bottom: 2rem !important;
    }
    
    .trombinoscope-header h1 {
        font-size: 1.5rem !important;
    }
    
    .filters-section {
        flex-direction: column;
        padding: 1.25rem !important;
    }
    
    .filter-group {
        width: 100%;
    }
    
    .reset-filters-btn {
        width: 100%;
    }
    
    .employees-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .employee-card {
        padding: 1.5rem !important;
    }
    
    .employee-photo,
    .employee-photo-placeholder {
        width: 110px !important;
        height: 110px !important;
    }
    
    .employee-name {
        font-size: 1.1rem !important;
    }
    
    /* Admin */
    .employees-photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.5rem !important;
    }
    
    .filters-bar {
        flex-direction: column;
    }
    
    .search-box,
    .filter-group {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .trombinoscope-container {
        padding: 1rem !important;
    }
    
    .trombinoscope-header {
        padding: 1.25rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 16px !important;
    }
    
    .trombinoscope-header h1 {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .trombinoscope-header p {
        font-size: 0.9rem !important;
    }
    
    /* Filtres pliables */
    .filters-section {
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        gap: 0.5rem !important;
        border-radius: 12px !important;
        margin-bottom: 1.5rem !important;
    }
    
    .filter-group {
        background: white;
        padding: 1rem;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .filter-group label {
        font-size: 0.85rem !important;
    }
    
    .filter-group input,
    .filter-group select {
        padding: 0.625rem !important;
        font-size: 0.9rem !important;
    }
    
    .reset-filters-btn {
        background: white !important;
        color: #64748b !important;
        border: 2px solid #e2e8f0 !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
    }
    
    .results-count {
        font-size: 1rem !important;
        margin-bottom: 1.25rem !important;
    }
    
    /* Grille 2 colonnes sur mobile */
    .employees-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .employee-card {
        padding: 0.75rem !important;
        border-radius: 12px !important;
    }
    
    .employee-photo,
    .employee-photo-placeholder {
        width: 70px !important;
        height: 70px !important;
        border-width: 2px !important;
        margin-bottom: 0.75rem !important;
    }
    
    .employee-photo-placeholder {
        font-size: 2rem !important;
    }
    
    .employee-name {
        font-size: 0.85rem !important;
        margin-bottom: 0.25rem !important;
    }
    
    .employee-poste {
        font-size: 0.75rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .employee-department {
        font-size: 0.7rem !important;
        padding: 0.25rem 0.5rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .employee-contact {
        display: none !important;
    }
    
    /* Cacher bouton "Voir plus" sur mobile (scroll infini à la place) */
    .load-more-btn {
        display: none !important;
    }

    
    /* Admin mobile */
    .trombinoscope-admin-container {
        padding: 0.75rem !important;
    }
    
    .employees-photo-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.75rem !important;
    }
    
    .employee-photo-card {
        padding: 1rem !important;
    }
    
    .photo-preview-img,
    .photo-placeholder {
        width: 80px !important;
        height: 80px !important;
    }
    
    .photo-placeholder {
        font-size: 2rem !important;
    }
    
    .employee-name-card {
        font-size: 0.9rem !important;
    }
    
    .employee-poste-card {
        font-size: 0.8rem !important;
    }
    
    .photo-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .photo-actions button {
        width: 100%;
        font-size: 0.85rem;
        padding: 0.625rem;
    }
}

/* ========================================
   PAGE DOCUMENTS - RESPONSIVE
   ======================================== */

/* Tablette */
@media (max-width: 768px) {
    .documents-page {
        padding: 1.5rem !important;
    }
    
    .page-header {
        padding: 2rem 1.5rem !important;
        border-radius: 12px !important;
    }
    
    .page-header h1 {
        font-size: 2rem !important;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .search-input {
        min-width: 100%;
    }
    
    .categories-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.25rem !important;
    }
    
    .category-card {
        padding: 1.25rem !important;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .document-actions {
        width: 100%;
        justify-content: stretch;
    }
    
    .view-btn, .download-btn {
        flex: 1;
    }
    
    .preview-content {
        width: 95vw !important;
        height: 90vh !important;
    }
    
    .preview-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .preview-actions {
        width: 100%;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .documents-page {
        padding: 1rem !important;
    }
    
    /* Afficher le toggle sur mobile */
    .view-toggle {
        display: flex !important;
        gap: 0.25rem;
        background: #e0e8f0;
        padding: 0.25rem;
        border-radius: 8px;
    }
    
    .view-toggle .view-btn {
        flex: 1;
        padding: 0.5rem;
        border: none;
        background: transparent;
        color: #5a7fa0;
        border-radius: 6px;
        font-size: 1.25rem;
        cursor: pointer;
        transition: all 0.2s;
    }
    
    .view-toggle .view-btn.active {
        background: #2c5f8d;
        color: white;
    }
    
    .page-header {
        padding: 1.5rem 1.25rem !important;
        border-radius: 16px !important;
        margin-bottom: 1.5rem !important;
    }
    
    .page-header h1 {
        font-size: 1.5rem !important;
    }
    
    .page-header p {
        font-size: 0.95rem !important;
    }
    
    /* Filtres et recherche */
    .search-filters {
        padding: 1rem !important;
        margin-bottom: 1.5rem !important;
        border-radius: 12px !important;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .search-input {
        min-width: 100%;
        padding: 0.625rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    .filter-select {
        padding: 0.625rem 1rem !important;
        font-size: 0.9rem !important;
    }
    
    /* Grille catégories - 1 colonne sur mobile */
    .categories-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .category-card {
        padding: 1rem !important;
        border-radius: 12px !important;
    }
    
    .category-icon {
        font-size: 2rem !important;
    }
    
    .category-info h3 {
        font-size: 1.1rem !important;
    }
    
    .category-count {
        font-size: 0.8rem !important;
    }
    
    .category-description {
        font-size: 0.85rem !important;
    }
    
    /* Bouton retour */
    .back-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.9rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* Liste documents */
    .documents-list {
        gap: 0.5rem !important;
    }
    
    .document-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 0.75rem !important;
        border-radius: 12px !important;
        gap: 0.75rem;
    }
    
    .document-icon {
        font-size: 1.5rem !important;
    }
    
    .document-content {
        width: 100%;
    }
    
    .document-title {
        font-size: 0.95rem !important;
        margin-bottom: 0.25rem !important;
        line-height: 1.3;
    }
    
    .document-meta {
        flex-direction: column;
        gap: 0.25rem;
        font-size: 0.75rem !important;
    }
    
    .document-description {
        font-size: 0.8rem !important;
        display: none; /* Cacher la description sur mobile pour gagner de la place */
    }
    
    /* Actions document */
    .document-actions {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem !important;
        margin-top: 0.5rem;
    }
    
    .view-btn, .download-btn {
        width: 100%;
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    
    /* Modal prévisualisation fullscreen mobile */
    .preview-modal {
        padding: 0 !important;
    }
    
    .preview-modal.active {
        display: flex !important;
        align-items: stretch !important;
        justify-content: stretch !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
    }
    
    .preview-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        max-height: 100vh !important;
        min-height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }
    
    .preview-header {
        padding: 0.75rem 1rem !important;
        flex-direction: column;
        gap: 0.5rem;
        position: sticky;
        top: 0;
        background: white;
        z-index: 10;
        border-radius: 0 !important;
        flex-shrink: 0;
        min-height: auto !important;
        max-height: auto !important;
    }
    
    .preview-header h3 {
        font-size: 0.9rem !important;
        margin: 0;
        word-wrap: break-word;
        line-height: 1.3;
    }
    
    .preview-actions {
        width: 100%;
        flex-direction: row;
        gap: 0.5rem;
    }
    
    .preview-actions .download-btn,
    .preview-actions .close-preview {
        flex: 1;
        padding: 0.6rem !important;
        font-size: 0.85rem !important;
        border-radius: 8px !important;
    }
    
    .preview-body {
        padding: 0 !important;
        overflow: hidden !important;
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
    }
    
    .preview-frame {
        border-radius: 0 !important;
        width: 100% !important;
        height: 100% !important;
        flex: 1 !important;
        border: none !important;
        background: #ffffff !important;
        object-fit: contain !important;
    }
    
    /* Pour les images dans l'iframe */
    .preview-body img,
    .preview-frame img {
        max-width: 100% !important;
        max-height: 100% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        display: block !important;
        margin: 0 auto !important;
    }
    
    /* Empty state */
    .empty-state {
        padding: 3rem 1.5rem !important;
    }
}

/* ========================================
   PAGE CARTE ANNIVERSAIRE - RESPONSIVE
   ======================================== */

/* Tablette */
@media (max-width: 768px) {
    .birthday-card .card-container {
        padding: 1.5rem;
    }
    
    .birthday-card .card-header {
        padding: 1.75rem;
    }
    
    .birthday-card .employee-photo {
        width: 130px;
        height: 130px;
    }
    
    .birthday-card .title {
        font-size: 1.75rem;
    }
    
    .birthday-card .card-body {
        padding: 1.75rem;
    }
    
    .birthday-card .quick-messages {
        gap: 0.4rem;
    }
    
    .birthday-card .quick-msg {
        font-size: 0.85rem;
        padding: 0.45rem 0.9rem;
    }
    
    .birthday-card .emoji-btn {
        font-size: 1.75rem;
        padding: 0.4rem;
    }
}

/* Mobile */
@media (max-width: 480px) {
    /* Container carte */
    .birthday-card .card-container {
        padding: 0.75rem;
        min-height: 100vh;
        align-items: flex-start;
    }
    
    .birthday-card .birthday-card {
        width: 100%;
        max-width: 100%;
    }
    
    .birthday-card .card-inner {
        border-radius: 16px;
        box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    }
    
    /* Header carte */
    .birthday-card .card-header {
        padding: 1.25rem;
    }
    
    .birthday-card .photo-container {
        margin-bottom: 0.75rem;
    }
    
    .birthday-card .employee-photo {
        width: 100px;
        height: 100px;
        border-width: 4px;
    }
    
    .birthday-card .sparkles {
        width: 150px;
        height: 150px;
    }
    
    .birthday-card .sparkle {
        width: 8px;
        height: 8px;
    }
    
    .birthday-card .title {
        font-size: 1.35rem;
        margin-bottom: 0.4rem;
    }
    
    .birthday-card .age-badge {
        font-size: 1.15rem;
        padding: 0.4rem 1.25rem;
    }
    
    /* Body carte */
    .birthday-card .card-body {
        padding: 1.25rem;
    }
    
    .birthday-card .message-section {
        margin-bottom: 1.25rem;
    }
    
    .birthday-card .message-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    /* Messages rapides */
    .birthday-card .quick-messages {
        gap: 0.35rem;
        margin-bottom: 0.75rem;
    }
    
    .birthday-card .quick-msg {
        font-size: 0.8rem;
        padding: 0.4rem 0.75rem;
    }
    
    /* Textarea */
    .birthday-card .custom-message {
        font-size: 0.95rem;
        padding: 0.875rem;
        border-radius: 10px;
    }
    
    /* Emoji bar */
    .birthday-card .emoji-bar {
        gap: 0.25rem;
        margin-bottom: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .birthday-card .emoji-btn {
        font-size: 1.5rem;
        padding: 0.35rem;
        border-radius: 10px;
    }
    
    /* Bouton envoyer */
    .birthday-card .send-btn {
        padding: 0.875rem;
        font-size: 1rem;
        border-radius: 10px;
    }
    
    /* Section voeux */
    .birthday-card .wishes-section {
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }
    
    .birthday-card .wishes-section h3 {
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
    }
    
    .birthday-card .wishes-list {
        max-height: 250px;
    }
    
    .birthday-card .wish-item {
        padding: 0.75rem;
        border-radius: 10px;
        margin-bottom: 0.5rem;
    }
    
    .birthday-card .wish-photo {
        width: 35px;
        height: 35px;
    }
    
    .birthday-card .wish-sender {
        font-size: 0.85rem;
    }
    
    .birthday-card .wish-message {
        font-size: 0.85rem;
    }
    
    .birthday-card .wish-emoji {
        font-size: 1.25rem;
    }
    
    /* Bouton retour */
    .birthday-card .back-btn {
        top: 0.75rem;
        left: 0.75rem;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
        border-radius: 25px;
    }
    
    /* Ballons réduits */
    .birthday-card .balloon {
        width: 45px;
        height: 55px;
    }
    
    .birthday-card .balloon::after {
        height: 30px;
    }
    
    /* Modal succès */
    .birthday-card .success-content {
        padding: 2rem;
        border-radius: 16px;
        margin: 1rem;
    }
    
    .birthday-card .success-icon {
        font-size: 3rem;
    }
    
    .birthday-card .success-text {
        font-size: 1.25rem;
    }
}

/* ========================================
   ADMIN ANNIVERSAIRES - RESPONSIVE
   ======================================== */

/* Mobile */
@media (max-width: 480px) {
    /* Stats anniversaires */
    .stats-grid-birthdays {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
    }
    
    .stats-grid-birthdays .stat-card {
        padding: 0.75rem 0.5rem !important;
    }
    
    /* Onglets */
    .tabs-container > div {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }
    
    .tab-btn {
        padding: 0.6rem 1rem !important;
        font-size: 0.85rem !important;
        white-space: nowrap !important;
    }
    
    /* Liste prochains */
    #upcoming-list {
        grid-template-columns: 1fr !important;
    }
    
    /* Graphique */
    #birthday-chart {
        max-height: 200px !important;
    }
    
    /* Liste calendrier */
    #calendar-list {
        grid-template-columns: 1fr !important;
    }
    
    /* Table tous les anniversaires en cartes */
    #all-birthdays-tbody tr {
        display: block !important;
        margin-bottom: 1rem !important;
        background: white !important;
        border: 2px solid #e0e8f0 !important;
        border-radius: 12px !important;
        padding: 1rem !important;
    }
    
    #all-birthdays-tbody td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.5rem 0 !important;
        border: none !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }
    
    #all-birthdays-tbody td:last-child {
        border-bottom: none !important;
        justify-content: center !important;
        padding-top: 0.75rem !important;
    }
    
    #all-birthdays-tbody td button {
        width: 100% !important;
    }
    
    /* Pagination */
    #all-pagination {
        flex-wrap: wrap !important;
        gap: 0.35rem !important;
    }
    
    #all-pagination button {
        padding: 0.5rem !important;
        font-size: 0.85rem !important;
        min-width: 36px !important;
    }
}

/* ========================================
   MODAL TROMBI DÉTAILLÉ - RESPONSIVE
   ======================================== */

/* Mobile - Tuiles thématiques */
@media (max-width: 768px) {
    .employee-modal-content {
        width: 95%;
        max-height: 85vh;
        overflow-y: auto;
        border-radius: 16px;
    }
    
    .employee-modal-header {
        padding: 1.25rem;
    }
    
    .modal-employee-photo,
    .modal-employee-photo-placeholder {
        width: 100px;
        height: 100px;
    }
    
    .employee-modal-body {
        padding: 1rem;
    }
    
    .info-theme-card {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .theme-header {
        gap: 0.5rem;
        margin-bottom: 1rem;
        padding-bottom: 0.75rem;
    }
    
    .theme-icon {
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
    
    .theme-title {
        font-size: 0.95rem;
    }
    
    .info-item {
        padding: 0.6rem;
        gap: 0.75rem;
    }
    
    .info-icon {
        font-size: 1.2rem;
    }
    
    .info-label {
        font-size: 0.7rem;
    }
    
    .info-value {
        font-size: 0.95rem;
    }
    
    .mission-text {
        padding: 0.75rem;
        font-size: 0.9rem;
    }
    
    .team-member {
        padding: 0.3rem 0.6rem;
        font-size: 0.8rem;
    }
}

