* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2d8659;
    --primary-dark: #1a5d3f;
    --sidebar-bg: #1f5d3f;
    --header-bg: #2d8659;
    --background: #f5f5f5;
    --card-background: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #e0e0e0;
    --success: #27ae60;
    --warning: #f39c12;
    --danger: #e74c3c;
    --info: #3498db;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--background);
    color: var(--text-primary);
    line-height: 1.6;
}

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

.top-header-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 600;
}

.top-header-logo i {
    font-size: 1.8rem;
}

.top-header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.9rem;
}

.top-header-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: background-color 0.3s;
}

.top-header-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.top-header-item i {
    font-size: 1rem;
}

.notification-badge {
    background-color: var(--danger);
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
    margin-left: 0.5rem;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 2rem 0 1rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    box-shadow: var(--shadow-lg);
}

/* Style de la scrollbar pour la sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.5rem;
    margin-bottom: 2rem;
}

.logo i {
    font-size: 2rem;
    flex-shrink: 0;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 600;
    white-space: nowrap;
}

.system-logo {
    max-width: 180px;
    max-height: 60px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

/* Logo dans la sidebar */
.logo .system-logo {
    max-width: 50px;
    max-height: 50px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    border-radius: 4px;
}

/* Assurer que l'icône de fallback s'affiche si l'image ne charge pas */
.logo i.fas.fa-seedling {
    display: block;
    flex-shrink: 0;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 1rem;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.875rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    cursor: pointer;
    font-size: 0.95rem;
}

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

.nav-item.active {
    background-color: rgba(255, 255, 255, 0.25);
    color: white;
    font-weight: 500;
}

.nav-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* Main Content */
.main-content {
    margin-left: 260px;
    flex: 1;
    padding: 0;
    max-width: calc(100vw - 260px);
    background-color: var(--background);
    min-height: calc(100vh);
    position: relative;
}

/* Barre de couleur en haut */
.top-color-bar {
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--primary-dark) 50%, var(--primary-color) 100%);
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.top-color-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        rgba(45, 134, 89, 0.8) 0%, 
        rgba(26, 93, 63, 0.9) 25%,
        rgba(45, 134, 89, 0.8) 50%,
        rgba(26, 93, 63, 0.9) 75%,
        rgba(45, 134, 89, 0.8) 100%);
    animation: shimmer 3s ease-in-out infinite;
}

@keyframes shimmer {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.section {
    display: none;
}

.section.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin: 2.5rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    border-radius: 12px;
    animation: fadeIn 0.5s ease-out;
    position: relative;
}

.section-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    border-radius: 12px 0 0 12px;
}

.header-content {
    flex: 1;
}

.header-title-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.section-header h2 {
    font-size: 2rem;
    color: var(--text-primary);
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-color) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.5px;
}

.section-header h2 i {
    color: var(--primary-color);
    font-size: 1.75rem;
    -webkit-text-fill-color: var(--primary-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    margin: 0;
    font-weight: 400;
    line-height: 1.5;
}

/* User Menu */
.user-menu-container {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    background: var(--card-background);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.user-menu-trigger:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.15);
    transform: translateY(-2px);
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.3);
    flex-shrink: 0;
}

.user-avatar.large {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.user-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

.user-menu-trigger i {
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: transform 0.3s ease;
    margin-left: auto;
}

.user-menu-trigger.active i {
    transform: rotate(180deg);
}

.user-menu-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.user-menu-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-menu-header {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
}

.user-menu-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 1;
}

.user-menu-details strong {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.user-menu-details span {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.user-role-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--primary-color);
    color: white;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: capitalize;
    margin-top: 0.25rem;
    width: fit-content;
}

.user-menu-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.user-menu-item:hover {
    background: rgba(45, 134, 89, 0.05);
    color: var(--primary-color);
    padding-left: 1.75rem;
}

.user-menu-item i {
    width: 20px;
    text-align: center;
    color: var(--text-secondary);
}

.user-menu-item:hover i {
    color: var(--primary-color);
}

.user-menu-item.logout {
    color: var(--danger);
}

.user-menu-item.logout:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--danger);
}

.user-menu-item.logout i {
    color: var(--danger);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

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

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c0392b;
}

.btn-warning {
    background-color: var(--warning);
    color: white;
}

.btn-warning:hover {
    background-color: #e67e22;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-success {
    background-color: var(--success);
    color: white;
}

.btn-success:hover {
    background-color: #229954;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

/* Quick Actions */
.quick-actions {
    background: var(--card-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.quick-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.05) 0%, rgba(255, 255, 255, 0) 100%);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s ease;
    cursor: pointer;
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.1) 0%, rgba(45, 134, 89, 0.05) 100%);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(45, 134, 89, 0.15);
}

.quick-action-btn i {
    font-size: 1.75rem;
    color: var(--primary-color);
    transition: transform 0.3s ease;
}

.quick-action-btn:hover i {
    transform: scale(1.1);
}

.quick-action-btn span {
    font-size: 0.9rem;
    font-weight: 500;
    text-align: center;
}

/* Charts Section */
.charts-section {
    margin-top: 2rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1.5rem;
}

.chart-card {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.chart-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(135deg, rgba(45, 134, 89, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
}

.chart-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chart-header h3 i {
    color: var(--primary-color);
}

.chart-body {
    padding: 1.5rem;
    height: 300px;
    position: relative;
}

/* Stats Grid - Design Moderne et Performant */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.75rem;
    margin: 0 2.5rem 2.5rem 2.5rem;
    animation: fadeInUp 0.6s ease-out;
}

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

.stat-card {
    background: var(--card-background);
    padding: 2rem 1.75rem;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07), 0 1px 3px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 200px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
    will-change: transform, box-shadow;
    animation: slideIn 0.5s ease-out backwards;
}

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

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    opacity: 0;
    transition: opacity 0.4s ease;
}

.stat-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(45, 134, 89, 0.2);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: white;
    margin-bottom: 1.25rem;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    will-change: transform;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.35);
}

.stat-icon.green {
    background: linear-gradient(135deg, #27ae60 0%, #2d8659 100%);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.35);
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    box-shadow: 0 6px 20px rgba(243, 156, 18, 0.35);
}

.stat-icon.purple {
    background: linear-gradient(135deg, #9b59b6 0%, #8e44ad 100%);
    box-shadow: 0 6px 20px rgba(155, 89, 182, 0.35);
}

.stat-icon.red {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.35);
}

.stat-icon.yellow {
    background: linear-gradient(135deg, #f1c40f 0%, #f39c12 100%);
    box-shadow: 0 6px 20px rgba(241, 196, 15, 0.35);
}

.stat-icon.teal {
    background: linear-gradient(135deg, #1abc9c 0%, #16a085 100%);
    box-shadow: 0 6px 20px rgba(26, 188, 156, 0.35);
}

.stat-icon.cyan {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    box-shadow: 0 6px 20px rgba(23, 162, 184, 0.35);
}

.stat-card.action-card .stat-icon {
    background: rgba(255, 255, 255, 0.2);
    margin-bottom: 0.5rem;
}

.stat-card.action-card .stat-icon i {
    font-size: 2rem;
}

.stat-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.stat-info h3 {
    font-size: 2.75rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
    line-height: 1;
    transition: all 0.3s ease;
    letter-spacing: -0.5px;
}

.stat-card:hover .stat-info h3 {
    transform: scale(1.05);
}

.stat-card.action-card .stat-info h3 {
    color: white;
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin: 0;
    font-weight: 500;
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.stat-card:hover .stat-info p {
    color: var(--text-primary);
}

.stat-card.action-card .stat-info p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.85rem;
}

.stat-card.action-card .action-icon {
    font-size: 3rem;
    margin-top: 0.5rem;
    opacity: 0.8;
}

/* Info Bar */
.info-bar {
    background: var(--card-background);
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 500;
    color: var(--text-primary);
}

/* Small Stats Cards */
.small-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.small-stat-card {
    background: var(--card-background);
    padding: 1.25rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.small-stat-card label {
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.small-stat-card .value {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
}

/* Tables */
.table-container {
    background: var(--card-background);
    border-radius: 12px;
    box-shadow: var(--shadow);
    overflow: hidden;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background-color: var(--primary-color);
    color: white;
}

.data-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.data-table tbody tr {
    transition: background-color 0.2s ease;
}

.data-table tbody tr:hover {
    background-color: #f8f9fa;
}

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

/* Badges */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

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

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

.badge-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

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

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
    align-items: center;
    justify-content: center;
}

.modal.active,
.modal[style*="display: flex"],
.modal[style*="display:block"] {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: var(--card-background);
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--primary-color);
    color: white;
    border-radius: 12px 12px 0 0;
}

.modal-header h3 {
    font-size: 1.5rem;
    color: white;
}

.close {
    font-size: 2rem;
    font-weight: 300;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease;
    opacity: 0.9;
}

.close:hover {
    opacity: 1;
}

/* Forms */
form {
    padding: 1.5rem;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 0.9rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
    background-color: #fff;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(45, 134, 89, 0.1);
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
    border-color: rgba(45, 134, 89, 0.3);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.gps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.data-table td .btn {
    margin-right: 0.25rem;
}

.data-table td .btn:last-child {
    margin-right: 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Content Section */
.content-section {
    margin: 0 2.5rem 2.5rem 2.5rem;
}

/* Form Container */
.form-container {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    max-width: 800px;
    margin: 0 auto;
}

.form-container h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.form-container h3 i {
    color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-style: italic;
}

.detail-container {
    background: var(--card-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-item strong {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-item span,
.detail-item p {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 2rem;
    padding-bottom: 0;
    overflow-x: auto;
    flex-wrap: wrap;
}

.tabs::-webkit-scrollbar {
    height: 4px;
}

.tabs::-webkit-scrollbar-track {
    background: var(--border-color);
}

.tabs::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 2px;
}

.tab-btn {
    padding: 0.875rem 1.5rem;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    margin-bottom: -2px;
}

.tab-btn i {
    font-size: 1rem;
}

.tab-btn:hover {
    color: var(--primary-color);
    background-color: rgba(45, 134, 89, 0.05);
    border-radius: 8px 8px 0 0;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background-color: rgba(45, 134, 89, 0.08);
    border-radius: 8px 8px 0 0;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideDown 0.3s ease;
    position: relative;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-success {
    background-color: #d4edda;
    color: #155724;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background-color: #f8d7da;
    color: #721c24;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background-color: #fff3cd;
    color: #856404;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid var(--info);
}

.alert-dismissible {
    position: relative;
}

.alert .close {
    background: none;
    border: none;
    font-size: 1.5rem;
    font-weight: 300;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s;
    padding: 0;
    margin: 0;
    line-height: 1;
}

.alert .close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 70px;
    }

    .sidebar .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 70px;
        max-width: calc(100vw - 70px);
        padding: 0.5rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        margin: 0 1rem 1.5rem 1rem;
    }

    .tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }

    .tab-btn span {
        display: none;
    }

    .tab-btn {
        padding: 0.75rem 1rem;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        margin: 1.5rem 1rem;
        padding: 1rem;
    }

    .table-container {
        overflow-x: auto;
    }

    .top-header-right {
        font-size: 0.8rem;
        gap: 0.5rem;
    }

    .top-header-item span {
        display: none;
    }

    /* Content Section - Marges réduites sur mobile */
    .content-section {
        margin: 0 1rem 1.5rem 1rem;
    }

    /* Form Container - Padding réduit sur mobile */
    .form-container {
        padding: 1.25rem;
        margin: 0;
    }

    .form-container h3 {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
        padding-bottom: 0.75rem;
    }

    /* Form Groups - Ajustements pour mobile */
    .form-group {
        margin-bottom: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.75rem 0.875rem;
        font-size: 16px; /* Évite le zoom automatique sur iOS */
    }

    .form-group textarea {
        min-height: 80px;
        resize: vertical;
        overflow-y: auto;
    }

    /* Form Actions - Boutons empilés sur mobile */
    .form-actions {
        flex-direction: column;
        gap: 0.75rem;
        margin-top: 1.5rem;
        padding-top: 1.25rem;
    }

    .form-actions .btn {
        width: 100%;
        justify-content: center;
    }

    /* Detail Grid - Une colonne sur mobile */
    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .detail-container {
        padding: 1.25rem;
    }

    /* Form Row - Une colonne sur mobile */
    .form-row {
        grid-template-columns: 1fr;
    }

    /* Grid pour coordonnées GPS - Une colonne sur mobile */
    .gps-grid {
        grid-template-columns: 1fr !important;
        gap: 0.75rem !important;
    }

    /* Upload area - Ajustements mobile */
    .upload-area {
        padding: 1.5rem 1rem !important;
    }

    .upload-area i.fas.fa-camera {
        font-size: 2.5rem !important;
        margin-bottom: 0.75rem !important;
    }

    .upload-area p {
        font-size: 0.9rem !important;
        margin: 0.25rem 0 !important;
    }
}

@media (max-width: 480px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        padding: 0.5rem;
    }

    .modal-content {
        width: 95%;
        margin: 1rem;
    }

    /* Content Section - Marges encore plus réduites sur petits écrans */
    .content-section {
        margin: 0 0.75rem 1.25rem 0.75rem;
    }

    /* Form Container - Padding minimal sur petits écrans */
    .form-container {
        padding: 1rem;
        border-radius: 8px;
    }

    .form-container h3 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
    }

    /* Form Groups - Ajustements fins */
    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.625rem 0.75rem;
    }

    /* Section Header - Ajustements */
    .section-header {
        margin: 1rem 0.75rem;
        padding: 0.875rem;
    }

    /* Stats Grid - Marges réduites */
    .stats-grid {
        margin: 0 0.75rem 1.25rem 0.75rem;
        gap: 1rem;
    }

    /* Grid pour coordonnées GPS - Une colonne sur petits écrans */
    .gps-grid {
        grid-template-columns: 1fr !important;
        gap: 0.625rem !important;
    }

    /* Upload area - Ajustements petits écrans */
    .upload-area {
        padding: 1.25rem 0.875rem !important;
    }

    .upload-area i.fas.fa-camera {
        font-size: 2rem !important;
    }

    .upload-area p {
        font-size: 0.85rem !important;
    }
}
