* {
    box-sizing: border-box;
}

:root {
    --bg-color: #08090a;
    --sidebar-bg: #111111;
    --card-bg: #1a1b1e;
    --text-color: #ffffff;
    --text-muted: #9ca3af;
    --accent-purple: #8b5cf6;
    --accent-violet: #d946ef;
    --accent-cyan: #00d2ff;
    --accent-gradient: linear-gradient(135deg, var(--accent-purple) 0%, var(--accent-violet) 100%);
    --border-color: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(26, 27, 30, 0.7);
}

body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 0% 0%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 100% 100%, rgba(217, 70, 239, 0.05) 0%, transparent 50%);
    color: var(--text-color);
    font-family: 'DM Sans', 'Inter', sans-serif;
    margin: 0;
    overflow-x: hidden;
    min-height: 100vh;
}

/* Mobile Header */
.mobile-header {
    background-color: var(--sidebar-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1001;
}

.sidebar-toggle {
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    color: white;
    padding: 8px 12px;
    border-radius: 10px;
}

/* Sidebar Styling */
.sidebar {
    width: 280px;
    height: 100vh;
    background-color: var(--sidebar-bg);
    position: fixed;
    left: 0;
    top: 0;
    padding: 24px;
    border-right: 1px solid var(--border-color);
    z-index: 1000;
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.main-content {
    margin-left: 280px;
    padding: 40px;
    min-height: 100vh;
}

.nav-link {
    color: var(--text-muted);
    padding: 14px 18px;
    border-radius: 14px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none !important;
    font-weight: 500;
}

.nav-link i {
    margin-right: 14px;
    font-size: 1.3rem;
}

.nav-link:hover {
    background-color: rgba(139, 92, 246, 0.1);
    color: var(--accent-purple);
    transform: translateX(5px);
}

.nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
}

/* Card Styling */
.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    color: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.4);
    margin-bottom: 24px;
    backdrop-filter: blur(12px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.6);
    border-color: rgba(139, 92, 246, 0.3);
}

.card-header {
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
    font-weight: 600;
}

/* Form Controls */
.form-control, .form-select {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    color: white;
    border-radius: 16px;
    padding: 12px 20px;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.form-control:focus, .form-select:focus {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-purple);
    color: white;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.1);
}

.form-label {
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-muted);
}

/* Button Styling Refinements */
.btn {
    border-radius: 16px;
    padding: 12px 24px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.9rem;
    border: none;
}

.btn-sm {
    padding: 10px 18px;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--accent-gradient);
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.2) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.5);
    background: var(--accent-gradient);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-2px);
}

.btn-info {
    background: linear-gradient(135deg, var(--accent-cyan) 0%, #3a7bd5 100%);
    color: white !important;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5);
}

/* Gap helper for older bootstrap if needed */
.gap-2 { gap: 0.5rem !important; }
.table {
    --bs-table-bg: transparent !important;
    --bs-table-color: var(--text-color) !important;
    --bs-table-striped-bg: rgba(255, 255, 255, 0.02) !important;
    --bs-table-striped-color: var(--text-color) !important;
    --bs-table-active-bg: rgba(255, 255, 255, 0.1) !important;
    --bs-table-active-color: var(--text-color) !important;
    --bs-table-hover-bg: rgba(139, 92, 246, 0.05) !important;
    --bs-table-hover-color: var(--text-color) !important;
    --bs-table-border-color: var(--border-color) !important;
    
    color: var(--text-color) !important;
    vertical-align: middle;
    border-color: var(--border-color);
}

.table-dark {
    --bs-table-bg: rgba(0, 0, 0, 0.2) !important;
    --bs-table-border-color: var(--border-color) !important;
}

.table thead th {
    background-color: rgba(255, 255, 255, 0.02) !important;
    border-bottom: 2px solid var(--border-color) !important;
    color: var(--text-muted) !important;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 20px;
}

.table tbody td {
    background-color: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--text-color) !important;
    padding: 20px;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(255, 255, 255, 0.02) !important;
    box-shadow: none !important;
    color: var(--text-color) !important;
}

.table-hover > tbody > tr:hover > * {
    background-color: rgba(139, 92, 246, 0.05) !important;
    box-shadow: none !important;
    color: var(--text-color) !important;
}

/* Pagination Styling */
.pagination .page-link {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-muted);
    margin: 0 4px;
    border-radius: 10px;
    padding: 10px 18px;
    transition: all 0.3s ease;
}

.pagination .page-item.active .page-link {
    background: var(--accent-gradient);
    border-color: transparent;
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.pagination .page-link:hover:not(.active) {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--accent-purple);
    color: var(--accent-purple);
}

/* Modern Button Refinements */
.btn {
    border-radius: 12px;
    padding: 10px 20px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border-color);
    color: white;
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
}

.btn-warning:hover {
    background-color: rgba(245, 158, 11, 0.25);
    border-color: #fbbf24;
    color: #fbbf24;
}

.btn-danger {
    background-color: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #f87171;
}

.btn-danger:hover {
    background-color: rgba(239, 68, 68, 0.25);
    border-color: #f87171;
    color: #f87171;
}

.btn-success {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.btn-success:hover {
    background-color: rgba(16, 185, 129, 0.25);
    border-color: #34d399;
    color: #34d399;
}

/* Modal Styling */
.modal-content {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
}

.modal-header {
    border-bottom: 1px solid var(--border-color);
    padding: 24px;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 24px;
}

/* Badge Styling */
.badge {
    border-radius: 10px;
    padding: 8px 14px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.badge-rep {
    background-color: rgba(139, 92, 246, 0.15) !important;
    color: var(--accent-purple) !important;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Login Page Styling */
.login-container {
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at center, #1a1b1e 0%, #08090a 100%);
}

.login-card {
    width: 100%;
    max-width: 450px;
    padding: 40px;
    background: var(--glass-bg);
    border: 1px solid var(--border-color);
    border-radius: 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    color: white !important;
}

.login-card .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5) !important;
}

.login-card .form-control {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.05) !important;
}

/* Custom Marker Glow */
.custom-div-icon div {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
}

.custom-div-icon:hover div {
    transform: scale(1.3);
    box-shadow: 0 0 15px currentColor;
    z-index: 2000;
}

/* Tabs Styling */
.nav-tabs {
    border-bottom: 1px solid var(--border-color);
    gap: 10px;
    margin-bottom: 25px;
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    padding: 12px 25px;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
}

.nav-tabs .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-color);
}

.nav-tabs .nav-link.active {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

/* Modal Close Button */
.btn-close-white {
    filter: invert(1) grayscale(100%) brightness(200%);
}

.modal-header .btn-close {
    margin: -0.5rem -0.5rem -0.5rem auto;
}

/* Map Styling */
#map {
    border-radius: 24px;
    border: 1px solid var(--border-color);
    background-color: #1a1b1e;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: #2a2b2e;
    border-radius: 10px;
    border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-purple);
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    .sidebar.show {
        transform: translateX(0);
        box-shadow: 0 0 100px rgba(0, 0, 0, 0.8);
    }
    .main-content {
        margin-left: 0 !important;
        padding: 20px !important;
    }
    .card {
        padding: 20px !important;
        border-radius: 20px !important;
    }
    .table-responsive {
        border-radius: 15px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 15px;
    }
    .table-responsive table {
        min-width: 1000px; /* Force le scroll horizontal sur mobile */
    }
    /* Scrollbar horizontale personnalisée */
    .table-responsive::-webkit-scrollbar {
        height: 6px;
    }
    .table-responsive::-webkit-scrollbar-thumb {
        background: var(--accent-purple);
        border-radius: 10px;
    }
    .table-responsive::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
    }
    h2, h3 {
        font-size: 1.5rem;
    }
}
