:root {
    --primary: #0f172a;
    /* Slate 900 */
    --accent: #3b82f6;
    /* Blue 500 */
    --accent-hover: #2563eb;
    /* Blue 600 */
    --bg-body: #f8fafc;
    /* Slate 50 */
    --bg-card: #ffffff;
    --text-main: #1e293b;
    /* Slate 800 */
    --text-muted: #64748b;
    /* Slate 500 */
    --border: #e2e8f0;
    /* Slate 200 */

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --radius-md: 12px;
    --radius-lg: 16px;

    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-body);
    color: var(--text-main);
    margin: 0;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

h1,
h2,
h3,
h4,
.brand {
    font-family: var(--font-heading);
    color: var(--primary);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Navbar */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content {
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    font-size: 1.5rem;
    font-weight: 300;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.brand strong {
    font-weight: 700;
    color: var(--accent);
}

.brand-icon {
    font-size: 1.2em;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 2rem;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--accent);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.125rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Content Grid (Main + Sidebar) */
.content-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 2rem;
}

.main-column {
    flex: 1;
    /* Prend l'espace restant */
    min-width: 0;
    /* Important pour que l'enfant flex ne déborde pas */
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
}

@media (max-width: 900px) {
    .content-grid {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
}

/* Chart Container */
.chart-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    position: relative;
    /* Important pour ChartJS responsive */
    height: 400px;
    width: 100%;
    overflow: hidden;
}

canvas {
    max-width: 100% !important;
    max-height: 100% !important;
}

/* Map Container */
#map-container {
    height: 600px;
    width: 100%;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 4px solid #fff;
    z-index: 10;
}

/* City Header */
.city-header {
    background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%);
    color: white;
    padding: 3rem 0;
    margin-bottom: 2rem;
    text-align: center;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.city-header h1 {
    color: white;
    font-size: 2.5rem;
    margin: 0;
}

.city-header .badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.8rem;
    border-radius: 99px;
    font-size: 0.6em;
    vertical-align: middle;
    margin-left: 1rem;
}

/* Tables */
.table-wrapper {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    width: 100%;
    display: block;
}

table {
    width: 100%;
    border-collapse: collapse;
    white-space: nowrap;
}

th {
    background: #f8fafc;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-main);
}

tbody tr:hover {
    background-color: #f1f5f9;
}

tr:last-child td {
    border-bottom: none;
}

/* Footer */
.footer {
    background: var(--primary);
    color: #fff;
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer h3 {
    color: #fff;
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer p {
    color: #94a3b8;
    font-size: 0.95rem;
}

.footer ul {
    list-style: none;
    padding: 0;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer a {
    color: #cbd5e1;
    text-decoration: none;
}

.footer a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #1e293b;
    text-align: center;
    color: #64748b;
    font-size: 0.875rem;
}

/* Ads */
.ads-placeholder {
    background: #f1f5f9;
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-weight: 500;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 2rem 0;
}

/* Responsive */
@media (max-width: 900px) {
    .content-grid {
        grid-template-columns: 1fr;
        /* Stack main/sidebar */
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .navbar-content {
        flex-direction: column;
        height: auto;
        padding: 1rem 0;
        gap: 1rem;
    }

    .nav-links a {
        margin: 0 1rem;
    }

    #map-container {
        height: 400px;
    }

    .chart-wrapper {
        height: 300px;
        padding: 1rem;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .city-header h1 {
        font-size: 1.8rem;
    }
}