/* eFastWork Admin Enhanced Layout - v1.0 */
:root {
    --efw-primary: #0d6efd;
    --efw-secondary: #6c757d;
    --efw-success: #198754;
    --efw-info: #0dcaf0;
    --efw-warning: #ffc107;
    --efw-danger: #dc3545;
}

body {
    font-family: 'Poppins', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.sidebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    box-shadow: var(--shadow-lg);
    position: fixed;
    z-index: 1000;
    transition: all 0.3s ease;
}

[data-theme="dark"] .sidebar {
    background: linear-gradient(135deg, #5e81ff 0%, #7d5ba6 100%);
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    margin: 2px 10px;
    border-radius: 8px;
    transition: all 0.3s;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
}

.sidebar .nav-link i {
    margin-right: 12px;
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

.main-content {
    background-color: var(--bg-primary);
    min-height: 100vh;
    transition: all 0.3s ease;
    margin-left: 280px;
}

.header {
    background-color: var(--bg-elevated);
    box-shadow: var(--shadow-md);
    border-bottom: 1px solid var(--border-primary);
    padding: 15px 20px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.card {
    border: none;
    box-shadow: var(--shadow-sm);
    border-radius: 12px;
    transition: box-shadow 0.3s ease;
    margin-bottom: 1.5rem;
    background-color: var(--bg-elevated);
}

.card:hover {
    box-shadow: var(--shadow-md);
}

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

.badge-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
}

.stat-card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-card .card-body {
    padding: 1.5rem;
}

.stat-card .stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.stat-card .stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.action-btn {
    border-radius: 8px;
    padding: 10px 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.action-btn i {
    margin-right: 8px;
}

.recent-activity {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-primary);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
}

.welcome-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
}

/* Préchargement du thème */
html:not([data-theme]) {
    opacity: 0;
}

html[data-theme] {
    opacity: 1;
    transition: opacity 0.2s ease;
}

.welcome-card h3 {
    font-weight: 700;
}

.sidebar-brand {
    padding: 1.5rem 1rem;
    color: white;
    font-weight: 700;
    font-size: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.sidebar-brand i {
    margin-right: 10px;
}

.user-dropdown .dropdown-toggle::after {
    margin-left: 0.5rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
}

.alert {
    border-radius: 8px;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.table th {
    font-weight: 600;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

footer {
    background-color: white;
    border-top: 1px solid var(--efw-border);
    padding: 1rem 0;
    margin-top: auto;
}

.search-bar {
    background-color: #f1f3f9;
    border: none;
    border-radius: 20px;
    padding: 8px 15px;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: var(--efw-danger);
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    min-width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(220, 53, 69, 0);
    }
}

/* Styles pour les dropdowns de notifications et messages */
.dropdown-menu {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: none;
    border-radius: 8px;
}

.dropdown-item {
    padding: 0.75rem 1rem;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.dropdown-item.bg-light {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border-left: 3px solid #ffc107;
}

.dropdown-header {
    font-weight: 600;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.sidebar-toggle {
    background: transparent;
    border: none;
    color: var(--efw-text-primary);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar.collapsed {
    width: 70px;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .sidebar-brand span,
.sidebar.collapsed .sidebar-brand-text {
    display: none;
}

.sidebar.collapsed .nav-link i {
    margin-right: 0;
    text-align: center;
    width: 100%;
}

.main-content.full-width {
    margin-left: 70px;
}

.sidebar-menu {
    overflow-y: auto;
    max-height: calc(100vh - 150px);
}

.sidebar-section {
    padding: 0 10px;
    margin: 15px 0;
}

.sidebar-section-title {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 10px 20px 5px;
    font-weight: 600;
}

.quick-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.quick-stat {
    flex: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
    text-align: center;
    color: white;
}

.quick-stat .number {
    font-size: 1.2rem;
    font-weight: 600;
    display: block;
}

.quick-stat .label {
    font-size: 0.7rem;
    opacity: 0.8;
}

/* Lazy Loading Styles */
img.lazy-loading {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

img.lazy-loaded {
    opacity: 1;
}

img.lazy-error {
    opacity: 0.5;
    background: #f8d7da;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

@media (max-width: 992px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .nav-link span,
    .sidebar .sidebar-brand span,
    .sidebar .sidebar-brand-text {
        display: none;
    }

    .sidebar .nav-link i {
        margin-right: 0;
        text-align: center;
        width: 100%;
    }

    .main-content {
        margin-left: 70px;
    }

    .sidebar:not(.mobile-expanded) {
        transform: translateX(-100%);
    }

    .sidebar.mobile-expanded {
        transform: translateX(0);
        width: 280px;
    }

    .sidebar.mobile-expanded .nav-link span,
    .sidebar.mobile-expanded .sidebar-brand span,
    .sidebar.mobile-expanded .sidebar-brand-text {
        display: inline;
    }

    .sidebar.mobile-expanded .nav-link i {
        margin-right: 12px;
        width: 20px;
        text-align: center;
    }
}
