/* =============================================================
   IUT PARIS-SACLAY - GESTION DES STAGES
   Academic CSS - Optimized Version
   ============================================================= */

:root {
    /* Palette: Université Paris-Saclay / IUT d'Orsay */
    --bg-body: #f5f5f5;
    --bg-card: #ffffff;
    --bg-subtle: #fafafa;
    
    --text-heading: #5a1e3d;
    --text-body: #333333;
    --text-muted: #666666;
    
    --primary: #6b1d3d;
    --primary-hover: #5a1830;
    --primary-light: #f8e8ed;
    
    --accent: #00a3a3;
    --secondary: #8b2b5b;
    
    --border-color: #e0e0e0;
    --input-bg: #fafafa;

    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    /* Sidebar dimensions */
    --sidebar-width: 260px;
    --sidebar-collapsed-width: 70px;
    --header-height: 64px;
}

/* =============================================================
   UNIFIED FILTERS THEME
   ============================================================= */
.filter-panel {
    position: relative;
    border: 0 !important;
    border-radius: 16px !important;
    box-shadow: 0 4px 14px rgba(17, 24, 39, 0.06) !important;
    overflow: hidden;
    background: var(--bg-card);
}

.filter-panel::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), rgba(107, 29, 61, 0.12));
}

.filter-label-modern {
    font-size: 0.72rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 0.45rem;
    display: block;
}

.filter-input-group .input-group-text {
    border-radius: 12px 0 0 12px;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #64748b;
}

.filter-input-group .form-control {
    border-radius: 0 12px 12px 0;
    border-color: #e2e8f0;
    background: #fff;
}

.filter-input-group .form-control:focus,
.filter-select-modern:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(107, 29, 61, 0.08);
}

.filter-select-modern {
    border-radius: 12px;
    border-color: #e2e8f0;
    min-height: 42px;
    background-color: #fff;
}

.filter-actions-divider {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

/* =============================================================
   DESIGN SYSTEM: TABLES & TABS
   ============================================================= */
.ds-table {
    margin-bottom: 0;
}

.ds-table thead th {
    background-color: var(--primary-light) !important;
    color: var(--primary) !important;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.4px;
    border-bottom: 2px solid var(--primary) !important;
    padding: 0.8rem 1rem !important;
    vertical-align: middle !important;
}

.ds-table tbody td {
    vertical-align: middle !important;
    padding: 0.85rem 1rem !important;
}

.ds-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.ds-actions-end {
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.ds-tabs {
    border-bottom: none;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.ds-tabs .nav-link {
    border: none;
    background: transparent;
    color: var(--primary);
    font-weight: 700;
    border-radius: 12px;
    padding: 0.55rem 0.95rem;
}

.ds-tabs .nav-link:hover {
    background: var(--primary-light);
    color: var(--primary);
}

.ds-tabs .nav-link.active {
    background: #fff;
    color: var(--primary);
    border: 1px solid rgba(107, 29, 61, 0.15);
    box-shadow: var(--shadow-sm);
}

/* =============================================================
   FIX: VISIBILITÉ DES MENUS DÉROULANTS
   ============================================================= */
.main-content, 
.main-wrapper, 
.dashboard-layout,
.card, 
.card-body,
.container-fluid {
    overflow: visible !important;
}

/* S'assurer que le menu est vraiment au-dessus et visible */
.dropdown-menu {
    z-index: 9999 !important;
    position: absolute !important;
    background-color: white !important;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2) !important;
}

.dropdown-menu.show {
    display: block !important;
}

/* =============================================================
   CUSTOM SCROLLBARS
   ============================================================= */

/* Global Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
    border: 2px solid var(--bg-body);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

/* Sidebar Specific Scrollbar */
.sidebar-nav::-webkit-scrollbar {
    width: 5px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    border: none;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Sidebar Navigation Firefox */
.sidebar-nav {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

/* Global fixes for navigation issues */
html {
    scroll-behavior: smooth;
}

body {
    scroll-behavior: auto !important;
    overflow-x: hidden;
}

/* Dark Mode Palette */
body.dark-mode {
    --bg-body: #1a1a1a;
    --bg-card: #252525;
    --bg-subtle: #303030;
    
    --text-heading: #f5f5f5;
    --text-body: #d0d0d0;
    --text-muted: #999999;
    
    --primary: #d4849e;
    --primary-hover: #e8a5bb;
    --primary-light: #3d2630;
    
    --accent: #4dd4d4;
    --secondary: #c776a0;
    
    --border-color: #404040;
    --input-bg: #1a1a1a;
    
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.4);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.4);
}

/* =============================================================
   DASHBOARD LAYOUT - SIDEBAR
   ============================================================= */

body.dashboard-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: linear-gradient(180deg, #6b1d3d 0%, #4a1428 100%);
    color: #fff;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    overflow: hidden;
}

.sidebar.sidebar-collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #fff;
    text-decoration: none;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.15);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.brand-text {
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.nav-section {
    padding: 0.5rem 1.25rem;
    margin-top: 0.5rem;
}

.nav-section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255,255,255,0.5);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    white-space: nowrap;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.nav-item.active {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-left-color: var(--accent);
}

/* Prevent unwanted scroll behavior on navigation */
.nav-item {
    cursor: pointer;
    scroll-behavior: auto !important;
}

.nav-item:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--accent);
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.btn-toggle-sidebar {
    width: 100%;
    padding: 0.5rem;
    background: rgba(255,255,255,0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-toggle-sidebar:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* Sidebar Overlay (mobile) */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

/* =============================================================
   MAIN WRAPPER
   ============================================================= */

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
    min-width: 0; /* Important: allow content to shrink */
    max-width: 100%;
}

.main-wrapper.sidebar-collapsed {
    margin-left: var(--sidebar-collapsed-width);
}

/* Force table responsive behavior */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    margin-bottom: 1rem;
}

/* Top Header */
.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    z-index: 100;
    gap: 1rem;
}

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

.header-center {
    flex: 1;
    max-width: 500px;
}

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

/* Mobile menu button */
.btn-mobile-menu {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-body);
    padding: 0.5rem;
    cursor: pointer;
}

/* Breadcrumb */
.top-header .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.top-header .breadcrumb-item a {
    color: var(--text-muted);
}

.top-header .breadcrumb-item.active {
    color: var(--text-body);
}

/* Global Search */
.global-search {
    position: relative;
    width: 100%;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.75rem;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-subtle);
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.search-input:focus {
    background: var(--bg-card);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(107, 29, 61, 0.1);
    outline: none;
}

.search-shortcut {
    position: absolute;
    right: 1rem;
    padding: 0.15rem 0.5rem;
    background: var(--bg-subtle);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.7rem;
    color: var(--text-muted);
}

.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

/* Header Icon Buttons */
.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-subtle);
    color: var(--primary);
}

.notification-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 600;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Notifications Dropdown */
.notifications-dropdown {
    width: 360px;
    padding: 0;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.notifications-dropdown .dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-subtle);
}

.notifications-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    gap: 0.75rem;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--bg-subtle);
}

.notification-item.unread {
    background: var(--primary-light);
}

.notifications-dropdown .dropdown-footer {
    padding: 0.75rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
}

/* User Dropdown */
.user-dropdown .user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background 0.2s ease;
}

.user-dropdown .user-btn:hover {
    background: var(--bg-subtle);
}

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

.user-name {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-body);
}

.user-role {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* =============================================================
   MAIN CONTENT AREA
   ============================================================= */

.main-content {
    flex: 1;
    padding: 0.75rem;
    background: var(--bg-body);
}

@media (max-width: 575.98px) {
    .main-content {
        padding: 0.5rem;
    }
}

.alerts-container {
    margin-bottom: 1rem;
}

/* Dashboard Footer */
.dashboard-footer {
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
}

/* =============================================================
   RESPONSIVE SIDEBAR
   ============================================================= */

@media (max-width: 767.98px) {
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
        z-index: 1050;
    }
    
    /* Sidebar visible when not collapsed */
    body.sidebar-open .sidebar,
    .sidebar:not(.sidebar-collapsed) {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .header-center {
        display: none;
    }
    
    /* Show mobile menu button */
    .btn-mobile-menu {
        display: flex !important;
    }
    
    /* Sidebar overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
}

/* Sidebar mobile open state */
body.sidebar-mobile-open .sidebar {
    transform: translateX(0) !important;
}

@media (max-width: 575.98px) {
    .top-header {
        padding: 0 1rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .notifications-dropdown {
        width: 300px;
    }
}

/* =============================================================
   BOOTSTRAP OVERRIDES - COULEURS BORDEAUX
   ============================================================= */

/* Primary color override */
.bg-primary {
    background-color: #6b1d3d !important;
}

.text-primary {
    color: #6b1d3d !important;
}

.btn-primary {
    background-color: #6b1d3d !important;
    border-color: #6b1d3d !important;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #5a1830 !important;
    border-color: #5a1830 !important;
}

.btn-outline-primary {
    color: #6b1d3d !important;
    border-color: #6b1d3d !important;
}

.btn-outline-primary:hover {
    background-color: #6b1d3d !important;
    border-color: #6b1d3d !important;
    color: #fff !important;
}

.badge.bg-primary {
    background-color: #6b1d3d !important;
}

.border-primary {
    border-color: #6b1d3d !important;
}

.card-header.bg-primary {
    background-color: #6b1d3d !important;
}

/* Dark mode overrides */
body.dark-mode .bg-primary {
    background-color: #8b2b5b !important;
}

body.dark-mode .text-primary {
    color: #d4849e !important;
}

body.dark-mode .btn-primary {
    background-color: #8b2b5b !important;
    border-color: #8b2b5b !important;
}

body.dark-mode .btn-outline-primary {
    color: #d4849e !important;
    border-color: #d4849e !important;
}

body.dark-mode .btn-outline-primary:hover {
    background-color: #8b2b5b !important;
    color: #fff !important;
}

/* =============================================================
   BASE STYLES
   ============================================================= */

body {
    background-color: var(--bg-body);
    color: var(--text-body);
    font-family: 'Inter', 'Poppins', sans-serif;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text-heading);
    font-family: 'Poppins', sans-serif;
    font-weight: 700;
    margin-bottom: 1rem;
}

a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--accent);
}

/* =============================================================
   NAVIGATION
   ============================================================= */

.navbar {
    background-color: #fff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 0.8rem 0;
    border-top: 4px solid #6b1d3d;
    transition: all 0.3s ease;
}

.navbar-brand {
    font-weight: 800;
    font-size: 1.3rem;
    color: #6b1d3d !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.navbar-brand i {
    color: #6b1d3d;
}

.nav-link {
    color: #333 !important;
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    margin: 0 2px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.nav-link:hover, .nav-link.active {
    color: #6b1d3d !important;
    background-color: #f8e8ed;
}

/* Dark Mode Navbar */
body.dark-mode .navbar {
    background-color: #1e1e1e !important;
    border-top-color: #d4849e;
}

body.dark-mode .navbar-brand {
    color: #f5f5f5 !important;
}

body.dark-mode .navbar-brand i {
    color: #d4849e !important;
}

body.dark-mode .nav-link {
    color: #d0d0d0 !important;
}

body.dark-mode .nav-link:hover,
body.dark-mode .nav-link.active {
    color: #d4849e !important;
    background-color: #3d2630 !important;
}

/* =============================================================
   CARDS
   ============================================================= */

.card {
    background-color: var(--bg-card);
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card::before {
    content: '';
    display: block;
    height: 3px;
    background: linear-gradient(to right, var(--primary), var(--primary-light));
    width: 100%;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-header {
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    padding: 1.25rem 1.5rem;
    font-weight: 600;
    color: var(--text-heading);
}

.card-body {
    padding: 1.5rem;
    color: var(--text-body);
}

.card-footer {
    background-color: var(--bg-subtle);
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

body.dark-mode .card-header {
    background-color: rgba(255,255,255,0.05);
}

/* =============================================================
   BUTTONS
   ============================================================= */

.btn {
    border-radius: var(--radius-sm);
    font-weight: 600;
    padding: 0.6rem 1.25rem;
    border: none;
    transition: all 0.2s ease;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.btn-primary {
    background-color: #6b1d3d;
    color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.btn-primary:hover {
    background-color: #5a1830;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(107, 29, 61, 0.3);
}

.btn-secondary {
    background-color: #f8f8f8;
    color: #333;
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #e0e0e0;
}

.btn-outline-primary {
    background: transparent;
    border: 2px solid #6b1d3d;
    color: #6b1d3d;
}

.btn-outline-primary:hover {
    background-color: #6b1d3d;
    color: #fff;
}

/* Dark Mode Buttons */
body.dark-mode .btn-primary {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

body.dark-mode .btn-outline-primary {
    color: #d4849e !important;
    border-color: #d4849e !important;
}

body.dark-mode .btn-outline-primary:hover {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

/* =============================================================
   FORMS
   ============================================================= */

.form-control, .form-select {
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    color: var(--text-body);
}

.form-control:focus, .form-select:focus {
    background-color: var(--bg-card);
    border-color: var(--primary);
    color: var(--text-body);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Placeholder styling - more visible */
::placeholder {
    color: #888 !important;
    opacity: 1 !important;
}

.form-control::placeholder {
    color: #888 !important;
    opacity: 1 !important;
}

body.dark-mode ::placeholder {
    color: var(--text-muted);
    opacity: 1;
}

.input-group-text {
    background-color: var(--bg-subtle);
    color: var(--text-heading);
    border-color: var(--border-color);
}

body.dark-mode .input-group-text {
    background-color: var(--bg-subtle);
    color: var(--primary);
    border-color: var(--border-color);
}

/* =============================================================
   TABLES
   ============================================================= */

.table {
    color: var(--text-body);
    border-color: var(--border-color);
}

.table thead th {
    background-color: var(--primary-light);
    color: var(--text-heading);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 1rem;
}

body.dark-mode .table thead th {
    background-color: #3d2630;
    color: var(--text-heading);
}

.table tbody td {
    padding: 1rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
}

.table-hover tbody tr:hover {
    background-color: var(--bg-subtle);
}

/* =============================================================
   BADGES
   ============================================================= */

.badge {
    padding: 0.5em 0.8em;
    border-radius: 4px;
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
}

.bg-success { background-color: #dcfce7 !important; color: #166534 !important; }
.bg-danger { background-color: #fee2e2 !important; color: #991b1b !important; }
.bg-warning { background-color: #fff3e0 !important; color: #e65100 !important; }
.bg-info { background-color: #e1f5fe !important; color: #01579b !important; }
.bg-secondary { background-color: #f1f5f9 !important; color: #475569 !important; }

body.dark-mode .bg-success { background-color: rgba(16, 185, 129, 0.2) !important; color: #6ee7b7 !important; }
body.dark-mode .bg-danger { background-color: rgba(239, 68, 68, 0.2) !important; color: #fca5a5 !important; }
body.dark-mode .bg-warning { background-color: rgba(245, 158, 11, 0.2) !important; color: #fcd34d !important; }
body.dark-mode .bg-info { background-color: rgba(59, 130, 246, 0.2) !important; color: #93c5fd !important; }
body.dark-mode .bg-secondary { background-color: rgba(148, 163, 184, 0.2) !important; color: #cbd5e1 !important; }

/* =============================================================
   UTILITIES
   ============================================================= */

.text-primary { color: var(--primary) !important; }
.text-muted { color: var(--text-muted) !important; }
.shadow-sm { box-shadow: var(--shadow-sm) !important; }

body.dark-mode .text-dark { color: var(--text-body) !important; }
body.dark-mode .bg-light { background-color: var(--bg-subtle) !important; }
body.dark-mode .bg-white { background-color: var(--bg-card) !important; }

.avatar-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 0.8rem;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

/* Dropdown Dark Mode */
body.dark-mode .dropdown-menu {
    background-color: #252525;
    border-color: #404040;
}

body.dark-mode .dropdown-item {
    color: #d0d0d0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3d2630;
    color: #d4849e;
}

/* =============================================================
   ANIMATIONS
   ============================================================= */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.animated { animation-duration: 0.6s; animation-fill-mode: both; }
.fadeInUp { animation-name: fadeInUp; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }

/* =============================================================
   PARIS-SACLAY HOMEPAGE THEME
   ============================================================= */

/* Header */
.paris-saclay-header {
    background: linear-gradient(135deg, #6b1d3d 0%, #8b2b5b 100%) !important;
    padding: 1.5rem 0;
}

.paris-saclay-header .container {
    display: flex;
    justify-content: center;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255,255,255,0.95);
    padding: 1rem 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.logo-iut {
    max-height: 80px;
    width: auto;
}

.header-separator {
    width: 2px;
    height: 60px;
    background: #6b1d3d;
}

.header-title {
    display: flex;
    flex-direction: column;
}

.header-main {
    font-size: 1.4rem;
    font-weight: 700;
    color: #6b1d3d;
}

.header-sub {
    font-size: 0.9rem;
    color: #666;
}

/* Hero Section */
.hero-section-ps {
    background: #fff;
    padding: 3rem 0;
    border-bottom: 1px solid #e0e0e0;
    animation: fadeIn 0.6s ease-out;
}

.hero-title-ps {
    font-size: 2.2rem;
    font-weight: 700;
    color: #6b1d3d !important;
    margin-bottom: 0.5rem;
}

.title-underline {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, #6b1d3d 0%, #00a3a3 100%) !important;
    margin-top: 0.8rem;
    border-radius: 2px;
}

.hero-description-ps {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 1.5rem 0 2rem;
}

.hero-actions-ps {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Paris-Saclay Buttons */
.btn-ps-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #6b1d3d !important;
    color: #fff !important;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
    border: none;
}

.btn-ps-primary:hover {
    background: #5a1830 !important;
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-ps-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: #6b1d3d !important;
    border: 2px solid #6b1d3d !important;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-ps-outline:hover {
    background: #6b1d3d !important;
    color: #fff !important;
}

/* Welcome Box */
.welcome-box-ps {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid #e0e0e0;
    margin-top: 1rem;
}

.welcome-box-ps .welcome-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #6b1d3d 0%, #00a3a3 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.welcome-box-ps .welcome-icon i {
    font-size: 1.3rem;
    color: #fff;
}

.welcome-box-ps .welcome-info {
    display: flex;
    flex-direction: column;
}

.welcome-box-ps .welcome-label {
    font-size: 0.8rem;
    color: #666;
}

.welcome-box-ps .welcome-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.welcome-box-ps .welcome-role {
    font-size: 0.85rem;
    color: #6b1d3d;
    font-weight: 500;
}

/* Stats Section */
.stats-section-ps {
    background: linear-gradient(135deg, #6b1d3d 0%, #5a1830 100%) !important;
    padding: 2.5rem 0;
}

.stat-card-ps {
    text-align: center;
    color: #fff !important;
    animation: fadeInUp 0.5s ease-out both;
}

.stat-card-ps:nth-child(1) { animation-delay: 0.1s; }
.stat-card-ps:nth-child(2) { animation-delay: 0.2s; }
.stat-card-ps:nth-child(3) { animation-delay: 0.3s; }
.stat-card-ps:nth-child(4) { animation-delay: 0.4s; }

.stat-card-ps .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.2;
    color: #fff !important;
}

.stat-label-ps {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.3rem;
    color: rgba(255,255,255,0.9) !important;
}

/* Access Section */
.access-section-ps {
    background: #fff;
    padding: 4rem 0;
}

.section-title-ps {
    font-size: 1.8rem;
    font-weight: 700;
    color: #6b1d3d !important;
    margin-bottom: 0;
}

.access-card-ps {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 2rem;
    height: 100%;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.5s ease-out both;
}

.access-card-ps:nth-child(1) { animation-delay: 0.1s; }
.access-card-ps:nth-child(2) { animation-delay: 0.2s; }
.access-card-ps:nth-child(3) { animation-delay: 0.3s; }

.access-card-ps:hover {
    box-shadow: 0 8px 25px rgba(107, 29, 61, 0.15);
    transform: translateY(-5px);
    border-color: #6b1d3d;
    border-left: 4px solid #6b1d3d;
}

.access-icon-ps {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.access-icon-ps.student {
    background: linear-gradient(135deg, #6b1d3d 0%, #a03d6a 100%) !important;
    color: #fff;
}

.access-icon-ps.teacher {
    background: linear-gradient(135deg, #00a3a3 0%, #008888 100%) !important;
    color: #fff;
}

.access-icon-ps.directory {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff;
}

.access-icon-ps i {
    font-size: 1.5rem;
}

.access-card-ps h3 {
    font-size: 1.3rem;
    margin-bottom: 0.8rem;
    color: #6b1d3d !important;
}

.access-description {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.access-list-ps {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    flex-grow: 1;
}

.access-list-ps li {
    padding: 0.4rem 0;
    color: var(--text-body);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.access-list-ps li i {
    color: #6b1d3d !important;
    font-size: 0.7rem;
}

.btn-access-ps {
    display: inline-block;
    background: #6b1d3d !important;
    color: #fff !important;
    padding: 0.7rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-top: auto;
}

.btn-access-ps:hover {
    background: #5a1830 !important;
    color: #fff !important;
    transform: translateY(-2px);
}

/* Offers Section */
.offers-section-ps {
    background: var(--bg-subtle);
    padding: 4rem 0;
}

.offer-card-ps {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    height: 100%;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.offer-card-ps:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-3px);
}

.offer-header-ps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.offer-type-ps {
    background: #f8e8ed !important;
    color: #6b1d3d !important;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.offer-date-ps {
    color: #666;
    font-size: 0.8rem;
}

.offer-title-ps {
    font-size: 1.1rem;
    font-weight: 600;
    color: #6b1d3d !important;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.offer-info-ps {
    flex-grow: 1;
    margin-bottom: 1rem;
}

.offer-info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.offer-info-item i {
    width: 16px;
    color: #6b1d3d !important;
}

.btn-offer-ps {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: #6b1d3d !important;
    border: 1px solid #6b1d3d !important;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    text-decoration: none;
    margin-top: auto;
}

.btn-offer-ps:hover {
    background: #6b1d3d !important;
    color: #fff !important;
}

/* Procedure Section */
.procedure-section-ps {
    background: #fff;
    padding: 4rem 0;
}

.step-card-ps {
    text-align: center;
    padding: 2rem 1.5rem;
    background: var(--bg-subtle);
    border-radius: var(--radius-lg);
    height: 100%;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    animation: fadeInUp 0.5s ease-out both;
}

.step-card-ps:hover {
    border-color: #6b1d3d !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.step-number-ps {
    width: 50px;
    height: 50px;
    background: #6b1d3d !important;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 1rem;
}

.step-card-ps h4 {
    font-size: 1.1rem;
    color: #6b1d3d !important;
    margin-bottom: 0.5rem;
}

.step-card-ps p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Info Section */
.info-section-ps {
    background: var(--bg-subtle);
    padding: 3rem 0;
}

.info-box-ps {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    height: 100%;
}

.info-box-icon {
    width: 50px;
    height: 50px;
    background: #f8e8ed !important;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.info-box-icon i {
    color: #6b1d3d !important;
    font-size: 1.2rem;
}

.info-box-content h4 {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    color: #6b1d3d !important;
}

.info-box-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-box-content li {
    color: var(--text-body);
    font-size: 0.9rem;
    padding: 0.3rem 0;
}

/* Footer */
.footer-ps {
    background: #2d2d2d;
    color: #fff;
    padding: 2rem 0;
}

.footer-content-ps {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-logo-ps img {
    height: 50px;
}

.footer-info-ps p {
    margin: 0;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
}

.footer-links-ps a {
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    transition: color 0.2s ease;
}

.footer-links-ps a:hover {
    color: #fff;
}

/* =============================================================
   DARK MODE - PARIS-SACLAY THEME
   ============================================================= */

body.dark-mode .paris-saclay-header {
    background: linear-gradient(135deg, #4a1428 0%, #6b2b4a 100%) !important;
}

body.dark-mode .header-branding {
    background: rgba(30, 30, 30, 0.95);
}

body.dark-mode .header-separator {
    background: #d4849e;
}

body.dark-mode .header-main {
    color: #d4849e;
}

body.dark-mode .header-sub {
    color: #999;
}

body.dark-mode .hero-section-ps {
    background: #252525;
}

body.dark-mode .hero-title-ps {
    color: #f5f5f5 !important;
}

body.dark-mode .hero-description-ps {
    color: #b0b0b0;
}

body.dark-mode .title-underline {
    background: linear-gradient(90deg, #d4849e 0%, #4dd4d4 100%) !important;
}

body.dark-mode .welcome-box-ps {
    background: #303030;
    border-color: #404040;
}

body.dark-mode .welcome-box-ps .welcome-icon {
    background: linear-gradient(135deg, #d4849e 0%, #4dd4d4 100%);
}

body.dark-mode .welcome-box-ps .welcome-label {
    color: #999;
}

body.dark-mode .welcome-box-ps .welcome-name {
    color: #f5f5f5;
}

body.dark-mode .welcome-box-ps .welcome-role {
    color: #d4849e;
}

body.dark-mode .btn-ps-primary {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

body.dark-mode .btn-ps-primary:hover {
    background: #e8a5bb !important;
}

body.dark-mode .btn-ps-outline {
    color: #d4849e !important;
    border-color: #d4849e !important;
}

body.dark-mode .btn-ps-outline:hover {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

body.dark-mode .stats-section-ps {
    background: linear-gradient(135deg, #4a1428 0%, #3a1020 100%) !important;
}

body.dark-mode .access-section-ps {
    background: #1e1e1e;
}

body.dark-mode .section-title-ps {
    color: #f5f5f5 !important;
}

body.dark-mode .access-card-ps {
    background: #252525;
    border-color: #404040;
}

body.dark-mode .access-card-ps:hover {
    border-color: #d4849e;
    border-left-color: #d4849e;
    box-shadow: 0 8px 25px rgba(212, 132, 158, 0.15);
}

body.dark-mode .access-card-ps h3 {
    color: #f5f5f5 !important;
}

body.dark-mode .access-description {
    color: #999;
}

body.dark-mode .access-list-ps li {
    color: #d0d0d0;
}

body.dark-mode .access-list-ps li i {
    color: #d4849e !important;
}

body.dark-mode .btn-access-ps {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

body.dark-mode .btn-access-ps:hover {
    background: #e8a5bb !important;
}

body.dark-mode .offers-section-ps {
    background: #1a1a1a;
}

body.dark-mode .offer-card-ps {
    background: #252525;
    border-color: #404040;
}

body.dark-mode .offer-type-ps {
    background: #3d2630 !important;
    color: #d4849e !important;
}

body.dark-mode .offer-title-ps {
    color: #f5f5f5 !important;
}

body.dark-mode .offer-info-item {
    color: #b0b0b0;
}

body.dark-mode .offer-info-item i {
    color: #d4849e !important;
}

body.dark-mode .btn-offer-ps {
    color: #d4849e !important;
    border-color: #d4849e !important;
}

body.dark-mode .btn-offer-ps:hover {
    background: #d4849e !important;
    color: #1a1a1a !important;
}

body.dark-mode .procedure-section-ps {
    background: #252525;
}

body.dark-mode .step-card-ps {
    background: #303030;
    border-color: #404040;
}

body.dark-mode .step-card-ps:hover {
    border-color: #d4849e !important;
}

body.dark-mode .step-number-ps {
    background: #d4849e !important;
    color: #1a1a1a;
}

body.dark-mode .step-card-ps h4 {
    color: #f5f5f5 !important;
}

body.dark-mode .step-card-ps p {
    color: #999;
}

body.dark-mode .info-section-ps {
    background: #1a1a1a;
}

body.dark-mode .info-box-ps {
    background: #252525;
    border-color: #404040;
}

body.dark-mode .info-box-icon {
    background: #3d2630 !important;
}

body.dark-mode .info-box-icon i {
    color: #d4849e !important;
}

body.dark-mode .info-box-content h4 {
    color: #f5f5f5 !important;
}

body.dark-mode .info-box-content li {
    color: #d0d0d0;
}

body.dark-mode .footer-ps {
    background: #151515;
}

body.dark-mode .footer-logo-ps img {
    filter: brightness(0.9);
}

/* =============================================================
   CARD HOVER EFFECTS & UI ENHANCEMENTS
   ============================================================= */

.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.hover-card {
    transition: all 0.3s ease;
}

.hover-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary) !important;
}

/* Hover underline effect for links */
.hover-underline:hover {
    text-decoration: underline !important;
}

/* Better card styling */
.card {
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
}

.card-header {
    border-radius: var(--radius-md) var(--radius-md) 0 0 !important;
}

/* Texte blanc bien visible dans les headers */
.card-header.bg-primary .text-white,
.card-header.bg-primary h1,
.card-header.bg-primary h2,
.card-header.bg-primary h3,
.card-header.bg-primary h4,
.card-header.bg-primary h5,
.card-header.bg-primary h6,
.card-header.bg-primary {
    color: #ffffff !important;
    opacity: 1 !important;
}

.card-footer {
    border-radius: 0 0 var(--radius-md) var(--radius-md) !important;
}

/* Better badges */
.badge {
    font-weight: 500;
    padding: 0.4em 0.8em;
    border-radius: 50px;
}

/* Progress bars */
.progress {
    border-radius: 10px;
    overflow: hidden;
}

.progress-bar {
    transition: width 0.6s ease;
}

/* Timeline styling */
.timeline-item {
    position: relative;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--accent));
}

/* Avatar improvements */
.avatar-circle {
    border: 2px solid rgba(255,255,255,0.3);
}

/* Link hover in cards */
.card a.text-dark:hover,
.card a.text-primary:hover {
    color: var(--primary) !important;
}

/* Form focus states */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(107, 29, 61, 0.15);
}

/* Better alert styling */
.alert {
    border-radius: var(--radius-md);
    border: none;
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
}

.alert-info {
    background-color: #e7f3ff;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
}

/* Breadcrumb */
.breadcrumb {
    background: transparent;
    padding: 0;
}

.breadcrumb-item a {
    color: var(--primary);
}

.breadcrumb-item.active {
    color: var(--text-muted);
}

/* Empty state styling */
.empty-state {
    padding: 3rem;
    text-align: center;
}

.empty-state i {
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* Button improvements */
.btn {
    border-radius: var(--radius-sm);
    font-weight: 500;
    transition: all 0.2s ease;
}

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

.btn-primary {
    background-color: var(--primary);
    border-color: var(--primary);
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Table improvements */
.table {
    border-radius: var(--radius-md);
    overflow: hidden;
}

.table thead th {
    border-bottom: 2px solid var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

.table-hover tbody tr:hover {
    background-color: var(--primary-light);
}

/* =============================================================
   TABLE MODERN - Design System
   ============================================================= */

.table-modern {
    width: 100%;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border-collapse: separate;
    border-spacing: 0;
}

.table-modern thead {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

.table-modern thead th {
    color: #fff !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
    padding: 1rem 1.25rem;
    border: none;
    white-space: nowrap;
}

.table-modern tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-color);
}

.table-modern tbody tr:last-child {
    border-bottom: none;
}

.table-modern tbody tr:hover {
    background-color: var(--primary-light);
}

.table-modern tbody td {
    padding: 1rem 1.25rem;
    vertical-align: middle;
    color: var(--text-body);
    border: none;
}

/* Actions discrètes au survol */
.table-modern .actions-cell {
    opacity: 0.3;
    transition: opacity 0.2s ease;
}

.table-modern tbody tr:hover .actions-cell {
    opacity: 1;
}

.table-modern .btn-action {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

/* Dark mode */
body.dark-mode .table-modern {
    background: var(--bg-card);
}

body.dark-mode .table-modern thead {
    background: linear-gradient(135deg, #4a1428 0%, #6b2b4a 100%);
}

body.dark-mode .table-modern tbody tr:hover {
    background-color: #3d2630;
}

/* =============================================================
   BADGE SOFT - Design System
   ============================================================= */

.badge-soft-primary {
    background-color: rgba(107, 29, 61, 0.15) !important;
    color: var(--primary) !important;
}

.badge-soft-secondary {
    background-color: rgba(139, 43, 91, 0.15) !important;
    color: var(--secondary) !important;
}

.badge-soft-success {
    background-color: rgba(16, 185, 129, 0.15) !important;
    color: #059669 !important;
}

.badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.15) !important;
    color: #dc2626 !important;
}

.badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.15) !important;
    color: #d97706 !important;
}

.badge-soft-info {
    background-color: rgba(59, 130, 246, 0.15) !important;
    color: #2563eb !important;
}

.badge-soft-light {
    background-color: rgba(241, 245, 249, 0.8) !important;
    color: #64748b !important;
}

.badge-soft-dark {
    background-color: rgba(30, 41, 59, 0.15) !important;
    color: #334155 !important;
}

/* Dark mode badges soft */
body.dark-mode .badge-soft-primary {
    background-color: rgba(212, 132, 158, 0.2) !important;
    color: #d4849e !important;
}

body.dark-mode .badge-soft-secondary {
    background-color: rgba(199, 118, 160, 0.2) !important;
    color: #c776a0 !important;
}

body.dark-mode .badge-soft-success {
    background-color: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
}

body.dark-mode .badge-soft-danger {
    background-color: rgba(239, 68, 68, 0.2) !important;
    color: #fca5a5 !important;
}

body.dark-mode .badge-soft-warning {
    background-color: rgba(245, 158, 11, 0.2) !important;
    color: #fcd34d !important;
}

body.dark-mode .badge-soft-info {
    background-color: rgba(59, 130, 246, 0.2) !important;
    color: #93c5fd !important;
}

/* =============================================================
   CARD STATS - Design System
   ============================================================= */

.card-stats {
    background: var(--bg-card);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card-stats::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary);
}

.card-stats:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.card-stats .stats-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.card-stats .stats-icon.bg-primary-soft {
    background: rgba(107, 29, 61, 0.12);
    color: var(--primary);
}

.card-stats .stats-icon.bg-success-soft {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.card-stats .stats-icon.bg-warning-soft {
    background: rgba(245, 158, 11, 0.12);
    color: #d97706;
}

.card-stats .stats-icon.bg-info-soft {
    background: rgba(59, 130, 246, 0.12);
    color: #2563eb;
}

.card-stats .stats-icon.bg-danger-soft {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

.card-stats .stats-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-heading);
    line-height: 1.2;
}

.card-stats .stats-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-top: 0.25rem;
}

.card-stats .stats-trend {
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.card-stats .stats-trend.up {
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
}

.card-stats .stats-trend.down {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}

/* Card Stats - Variantes colorées */
.card-stats.card-stats-primary::before { background: var(--primary); }
.card-stats.card-stats-success::before { background: #10b981; }
.card-stats.card-stats-warning::before { background: #f59e0b; }
.card-stats.card-stats-info::before { background: #3b82f6; }
.card-stats.card-stats-danger::before { background: #ef4444; }

/* Dark mode card stats */
body.dark-mode .card-stats {
    background: var(--bg-card);
}

body.dark-mode .card-stats .stats-icon.bg-primary-soft {
    background: rgba(212, 132, 158, 0.15);
    color: #d4849e;
}

body.dark-mode .card-stats .stats-icon.bg-success-soft {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
}

body.dark-mode .card-stats .stats-icon.bg-warning-soft {
    background: rgba(245, 158, 11, 0.15);
    color: #fcd34d;
}

body.dark-mode .card-stats .stats-icon.bg-info-soft {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
}

/* =============================================================
   AVATAR INITIALES - Design System
   ============================================================= */

.avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 50%;
    flex-shrink: 0;
}

.avatar-initials.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 0.75rem;
}

.avatar-initials.avatar-md {
    width: 42px;
    height: 42px;
    font-size: 0.9rem;
}

.avatar-initials.avatar-lg {
    width: 56px;
    height: 56px;
    font-size: 1.1rem;
}

.avatar-initials.avatar-xl {
    width: 80px;
    height: 80px;
    font-size: 1.5rem;
}

/* Couleurs d'avatars */
.avatar-primary { background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%); color: #fff; }
.avatar-success { background: linear-gradient(135deg, #10b981 0%, #059669 100%); color: #fff; }
.avatar-info { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); color: #fff; }
.avatar-warning { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); color: #fff; }
.avatar-danger { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); color: #fff; }
.avatar-teal { background: linear-gradient(135deg, var(--accent) 0%, #008888 100%); color: #fff; }

/* =============================================================
   FORM SECTIONS - Design System
   ============================================================= */

.form-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.form-section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-light);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i {
    color: var(--primary);
}

/* =============================================================
   RESPONSIVE - COMPLETE RULES
   ============================================================= */

/* Large screens (laptops, desktops) */
@media (max-width: 1200px) {
    .container-fluid {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .col-xl-4 {
        flex: 0 0 auto;
        width: 50%;
    }
    
    .card-body {
        padding: 1rem;
    }
}

/* Medium screens (tablets, small laptops) */
@media (max-width: 992px) {
    /* Sidebar */
    .sidebar {
        transform: translateX(-100%);
        width: var(--sidebar-width) !important;
    }
    
    .sidebar:not(.sidebar-collapsed) {
        transform: translateX(0);
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    /* Cards grid */
    .col-lg-4, .col-lg-3 {
        flex: 0 0 auto;
        width: 50%;
    }
    
    .col-lg-6 {
        flex: 0 0 auto;
        width: 100%;
    }
    
    /* Tables */
    .table-responsive {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Header */
    .header-center {
        display: none !important;
    }
    
    .header-left, .header-right {
        flex: 1;
    }
    
    /* Forms */
    .row.g-3 > .col-md-3,
    .row.g-3 > .col-md-4,
    .row.g-3 > .col-md-6 {
        width: 50%;
    }
    
    /* Hide non-essential elements */
    .d-lg-block {
        display: none !important;
    }
}

/* Small screens (landscape phones, small tablets) */
@media (max-width: 768px) {
    /* Global */
    body {
        font-size: 14px;
    }
    
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.5rem; }
    h3, .h3 { font-size: 1.25rem; }
    h4, .h4 { font-size: 1.1rem; }
    
    /* Layout */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    .main-content {
        padding: 1rem !important;
    }
    
    /* Cards */
    .col-md-6, .col-md-4, .col-md-3, .col-xl-4 {
        flex: 0 0 auto;
        width: 100% !important;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 0.75rem;
    }
    
    /* Forms */
    .row.g-3 > [class*="col-"] {
        width: 100% !important;
        margin-bottom: 0.5rem;
    }
    
    .form-control, .form-select {
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .input-group > * {
        width: 100%;
        border-radius: var(--radius-md) !important;
        margin-bottom: 0.25rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group > .btn {
        width: 100%;
        margin-bottom: 0.25rem;
        border-radius: var(--radius-md) !important;
    }
    
    .d-flex.gap-2, .d-flex.gap-3 {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    /* Tables */
    .table thead {
        display: none;
    }
    
    .table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--bg-card);
        border-radius: var(--radius-md);
        box-shadow: var(--shadow-sm);
        padding: 0.5rem;
    }
    
    .table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-heading);
        margin-right: 0.5rem;
    }
    
    .table tbody td:last-child {
        border-bottom: none;
    }
    
    /* Header */
    .top-header {
        padding: 0 0.5rem;
    }
    
    .user-info {
        display: none !important;
    }
    
    .user-btn {
        padding: 0.25rem;
    }
    
    /* Filters */
    .d-flex.flex-wrap.gap-2 {
        flex-direction: column;
    }
    
    .d-flex.flex-wrap.gap-2 > * {
        width: 100% !important;
        min-width: unset !important;
    }
    
    /* Pagination */
    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .pagination .page-item {
        margin: 0.125rem;
    }
    
    /* Modals */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    /* Alerts */
    .alert {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
    
    /* Badges */
    .badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.4rem;
    }
    
    /* Specific components */
    .header-branding {
        flex-direction: column;
        text-align: center;
        padding: 1rem;
    }
    
    .header-separator {
        width: 60px;
        height: 2px;
    }
    
    .hero-title-ps {
        font-size: 1.8rem;
    }
    
    .hero-actions-ps {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stat-card-ps .stat-value {
        font-size: 2rem;
    }
    
    .section-title-ps {
        font-size: 1.5rem;
    }
    
    .footer-content-ps {
        flex-direction: column;
        text-align: center;
    }
    
    .info-box-ps {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }
    
    /* Hide view toggle on mobile - show grid by default */
    .btn-group[role="group"] {
        display: none !important;
    }
    
    #listView {
        display: none !important;
    }
    
    #gridView {
        display: flex !important;
    }
}

/* Extra small screens (portrait phones) */
@media (max-width: 576px) {
    .main-content {
        padding: 0.5rem !important;
    }
    
    .card-body {
        padding: 0.5rem;
    }
    
    .btn {
        padding: 0.375rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .avatar-initials {
        width: 32px !important;
        height: 32px !important;
        font-size: 0.75rem !important;
    }
    
    /* Stack everything */
    .d-flex {
        flex-wrap: wrap;
    }
    
    .justify-content-between {
        justify-content: center !important;
        text-align: center;
    }
    
    /* Full width inputs */
    input, select, textarea, .form-control, .form-select {
        width: 100% !important;
    }
}

/* Print styles */
@media print {
    .sidebar, .top-header, .sidebar-overlay, .btn, .pagination {
        display: none !important;
    }
    
    .main-wrapper {
        margin-left: 0 !important;
    }
    
    .main-content {
        padding: 0 !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #ddd !important;
    }
}
