body.admin-page {
    overflow: auto !important;
}
/* --- ADMIN PANEL --- */
.admin-login-panel {
    max-width: 350px;
    margin: 80px auto 0 auto;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
    padding: 32px 28px 24px 28px;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.admin-login-panel h2 {
    margin-bottom: 24px;
    color: #2196F3;
}
.admin-login-panel input[type="password"],
.admin-login-panel input[type="text"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 18px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
}
.admin-login-panel button {
    width: 100%;
    padding: 10px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
    margin-bottom: 10px;
}
.admin-login-panel button:hover {
    background: #1976D2;
}
#adminMessage {
    color: #c62828;
    margin-top: 8px;
    font-size: 14px;
    text-align: center;
}
/* === ADMIN DASHBOARD LAYOUT === */
.admin-dashboard {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.admin-sidebar {
    width: 260px;
    min-width: 260px;
    background: #1a237e;
    color: white;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.admin-sidebar-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.admin-sidebar-header h2 {
    color: white;
    font-size: 1.2em;
    margin: 0;
}

.admin-nav {
    list-style: none;
    padding: 8px 0;
    flex: 1;
}

.admin-nav li {
    margin: 2px 0;
}

.admin-nav-link {
    display: block;
    padding: 12px 20px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.95em;
    border-left: 3px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}

.admin-nav-link:hover {
    background: rgba(255,255,255,0.08);
    color: white;
}

.admin-nav-link.active {
    background: rgba(255,255,255,0.12);
    color: white;
    border-left-color: #2196F3;
    font-weight: 600;
}

.admin-sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.admin-logout-btn {
    width: 100%;
    padding: 10px;
    background: rgba(244,67,54,0.8);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
}

.admin-logout-btn:hover {
    background: #f44336;
}

/* Main content area */
.admin-main {
    flex: 1;
    overflow-y: auto;
    background: #f5f5f5;
    padding: 24px 32px;
}

.admin-section {
    display: none;
}

.admin-section.active {
    display: block;
}

.admin-section h1 {
    color: #333;
    margin-bottom: 24px;
    font-size: 1.6em;
}

/* KPI row */
.admin-kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.admin-kpi-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border-left: 4px solid #ccc;
}

.admin-kpi-blue  { border-left-color: #2196F3; }
.admin-kpi-green { border-left-color: #4CAF50; }
.admin-kpi-orange { border-left-color: #FF9800; }
.admin-kpi-red   { border-left-color: #f44336; }

.admin-kpi-value {
    font-size: 2em;
    font-weight: 700;
    color: #333;
}

.admin-kpi-label {
    font-size: 0.85em;
    color: #666;
    margin-top: 4px;
}

/* Cards */
.admin-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-card h3 {
    color: #333;
    margin-bottom: 16px;
    font-size: 1.1em;
}

/* Grid layouts */
.admin-grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

/* Tables admin dashboard */
.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    background: #f1f3f5;
    padding: 10px 12px;
    text-align: left;
    font-size: 0.9em;
    color: #555;
    border-bottom: 2px solid #dee2e6;
}

.admin-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    font-size: 0.9em;
}

.admin-table tr:hover {
    background: #f8f9fa;
}

/* Temporal heatmap table */
.heatmap-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75em;
}

.heatmap-table th,
.heatmap-table td {
    padding: 4px 2px;
    text-align: center;
    min-width: 28px;
}

.heatmap-day {
    font-weight: 600;
    text-align: right !important;
    padding-right: 8px !important;
    color: #555;
}

.heatmap-cell {
    border-radius: 3px;
    color: #333;
    font-size: 0.85em;
}

/* Period selector */
.admin-period-selector {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.admin-period-btn {
    padding: 6px 16px;
    border: 1px solid #ddd;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    font-size: 0.85em;
    color: #555;
    transition: all 0.2s;
}

.admin-period-btn:hover {
    border-color: #2196F3;
    color: #2196F3;
}

.admin-period-btn.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Delete button in data management */
.admin-delete-btn {
    background: #f44336;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 14px;
}

.admin-delete-btn:hover {
    background: #d32f2f;
}

/* Loading indicator */
.admin-loading {
    text-align: center;
    padding: 40px;
    color: #999;
    font-size: 0.95em;
}

/* Responsive: sidebar collapses on small screens */
@media (max-width: 900px) {
    .admin-dashboard { flex-direction: column; }
    .admin-sidebar { width: 100%; min-width: auto; flex-direction: row; overflow-x: auto; }
    .admin-sidebar-header { display: none; }
    .admin-sidebar-footer { display: none; }
    .admin-nav { display: flex; padding: 0; }
    .admin-nav li { margin: 0; }
    .admin-nav-link {
        padding: 10px 12px;
        white-space: nowrap;
        border-left: none;
        border-bottom: 3px solid transparent;
    }
    .admin-nav-link.active {
        border-bottom-color: #2196F3;
        border-left-color: transparent;
    }
    .admin-main { padding: 16px; }
    .admin-grid-2col { grid-template-columns: 1fr; }
}
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    height: 100vh;
    overflow: hidden;
}

#map {
    width: 100%;
    height: 100vh;
}

.info-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
}

/* Panneau de suivi de vélo */
.follow-panel {
    position: absolute;
    top: 60px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.96);
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1100;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 700px;
}

.follow-panel.hidden {
    display: none;
}

.follow-panel-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.follow-bike-id {
    font-weight: bold;
    font-size: 15px;
}

.follow-bike-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #444;
}

.follow-panel-actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
}

.follow-panel-actions .trip-history-btn {
    width: auto;
    margin-top: 0;
    padding: 6px 10px;
    font-size: 12px;
}

.search-panel {
    position: absolute;
    top: 60px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 250px;
}

.search-panel h3 {
    margin: 0 0 10px 0;
    color: #333;
}

.search-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: #2196F3;
}

.search-btn {
    width: 100%;
    margin-top: 8px;
    padding: 8px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.search-btn:hover {
    background: #1976D2;
}

.search-result {
    margin-top: 10px;
    padding: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 13px;
    color: #666;
}

.search-result.success {
    background: #e8f5e9;
    color: #2e7d32;
}

.search-result.error {
    background: #ffebee;
    color: #c62828;
}

.info-panel h3 {
    margin-bottom: 10px;
    color: #333;
}

.stat {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #eee;
}

.stat:last-child {
    border-bottom: none;
}

.stat-label {
    color: #666;
    font-size: 14px;
}

.stat-value {
    color: #333;
    font-weight: bold;
    font-size: 14px;
}

.last-update {
    margin-top: 10px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.bike-marker {
    background: none;
    border: none;
}

.bike-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.bike-available {
    background: #4CAF50;
}

.bike-in-trip {
    background: #FF9800;
}

.bike-maintenance {
    background: #f69c96;
}

.station-marker {
    background: none;
    border: none;
}

.station-icon {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    background: #2196F3;
    border: 3px solid white;
    position: relative;
}

.station-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    border: 2px solid white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.leaflet-popup-content-wrapper {
    border-radius: 8px;
}

.popup-content {
    min-width: 180px;
}

.popup-content h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.popup-info {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    font-size: 13px;
}

.popup-label {
    color: #666;
}

.popup-value {
    font-weight: bold;
    color: #333;
}

.trip-history-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 13px;
}

.trip-history-btn:hover {
    background: #1976D2;
}

.trip-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.trip-modal-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 75%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.trip-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
}

.trip-modal-header h2 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}

.close-btn:hover {
    background: #d32f2f;
}

.trip-item {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f9f9f9;
}

.trip-item h3 {
    margin: 0 0 10px 0;
    color: #2196F3;
    font-size: 16px;
}

.trip-detail {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 13px;
}

.trip-detail-label {
    color: #666;
}

.trip-detail-value {
    font-weight: bold;
    color: #333;
}

.no-trips {
    text-align: center;
    padding: 40px;
    color: #999;
}

.view-on-map-btn {
    margin-top: 10px;
    padding: 6px 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 12px;
}

.view-on-map-btn:hover {
    background: #45a049;
}

.station-info-btn {
    margin-top: 10px;
    padding: 8px 12px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    font-size: 13px;
}

.station-info-btn:hover {
    background: #1976D2;
}

.station-vehicles-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.station-vehicles-content {
    background: white;
    padding: 20px;
    border-radius: 8px;
    width: 75%;
    max-width: 1000px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.vehicle-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 10px;
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.vehicle-item:hover {
    background: #f0f0f0;
}

.vehicle-info {
    flex: 1;
}

.vehicle-rank {
    background: #2196F3;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-weight: bold;
}
    
/* --- New UI Elements --- */

.station-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}

.vehicle-card {
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 8px;
    background: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.status-available {
    border-left: 4px solid #4CAF50;
}

.status-maintenance {
    border-left: 4px solid #f44336;
}

.kpi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
}

.kpi-box {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.modal-header-custom {
    margin-bottom: 20px;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* --- Heatmap Mode Toggle --- */
.mode-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 10px 0;
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.mode-label {
    font-size: 13px;
    color: #999;
    font-weight: 500;
    transition: color 0.3s;
    user-select: none;
}

.mode-label.active {
    color: #2196F3;
    font-weight: 700;
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 22px;
    display: inline-block;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #2196F3;
    border-radius: 22px;
    transition: background 0.3s;
}

.toggle-slider::before {
    content: '';
    position: absolute;
    height: 18px;
    width: 18px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
}

.toggle-switch input:checked + .toggle-slider {
    background: #FF9800;
}

.toggle-switch input:checked + .toggle-slider::before {
    transform: translateX(22px);
}

/* ==========================================================
   PUBLIC NAVBAR + SPA VIEW TRANSITIONS
   ========================================================== */

.public-navbar {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.55);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: flex;
    align-items: center;
    z-index: 1100;
    padding: 5px 6px;
    border-radius: 14px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.25),
                inset 0 0 0 0.5px rgba(255,255,255,0.15);
    gap: 4px;
}

.navbar-brand {
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    font-size: 0.85em;
    padding: 0 10px 0 8px;
    border-right: 1px solid rgba(255,255,255,0.15);
    margin-right: 2px;
}

.navbar-tabs { display: flex; gap: 3px; }

.navbar-tab {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.75);
    padding: 7px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.2s ease;
    font-family: inherit;
    white-space: nowrap;
}

.navbar-tab:hover {
    background: rgba(255,255,255,0.12);
    color: white;
}

.navbar-tab.active {
    background: rgba(255,255,255,0.2);
    color: white;
    font-weight: 600;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* Map – full screen behind floating dock */
body:not(.admin-page) #map {
    position: fixed;
    top: 0;
    left: 0; right: 0; bottom: 0;
    width: 100%;
    height: 100vh !important;
}

/* View overlays (each SPA view) – macOS-style full slide */
.view-overlays {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    transform: translateX(100%);
    transition: transform 0.45s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 1000;
}

.view-overlays > * { pointer-events: auto; }

.view-overlays.active {
    transform: translateX(0);
}

.view-overlays.exit-left {
    transform: translateX(-100%);
}

.view-overlays.exit-right {
    transform: translateX(100%);
}

.view-overlays.enter-left {
    transform: translateX(-100%);
    transition: none;
}

.view-overlays.enter-right {
    transform: translateX(100%);
    transition: none;
}

/* --- Playback view styles --- */
.timeline-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    z-index: 1200;
    padding: 0;
    box-shadow: 0 -2px 16px rgba(0,0,0,0.4);
    display: flex;
    flex-direction: column;
}

.timeline-progress-wrapper {
    width: 100%;
    height: 28px;
    cursor: pointer;
    position: relative;
    background: #333;
}

.timeline-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2196F3, #42a5f5);
    width: 0%;
    transition: width 0.15s linear;
    position: relative;
}

.timeline-progress-wrapper:hover .timeline-progress-bar {
    background: linear-gradient(90deg, #1976D2, #2196F3);
}

.timeline-progress-thumb {
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 6px rgba(0,0,0,0.4);
    pointer-events: none;
}

.timeline-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 16px;
}

.timeline-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.15s;
    line-height: 1;
}

.timeline-btn:hover { background: rgba(255,255,255,0.15); }
.timeline-btn.active { color: #42a5f5; }

.timeline-time {
    font-size: 15px;
    font-weight: 600;
    font-family: 'Segoe UI', monospace;
    min-width: 180px;
    text-align: center;
}

.timeline-speed {
    font-size: 13px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
}

.timeline-speed:hover { background: rgba(255,255,255,0.2); }

.timeline-date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.timeline-date-inputs input {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 13px;
}

.timeline-date-inputs input:focus {
    outline: none;
    border-color: #42a5f5;
}

.timeline-date-inputs label {
    font-size: 12px;
    color: #aaa;
}

.timeline-go-btn {
    background: #2196F3;
    border: none;
    color: #fff;
    padding: 5px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.timeline-go-btn:hover { background: #1976D2; }

/* Playback panels */
.history-info-panel {
    position: absolute;
    top: 60px;
    right: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 220px;
}

.history-info-panel h3 {
    margin-bottom: 10px;
    color: #333;
}

.history-nav-panel {
    position: absolute;
    top: 60px;
    left: 10px;
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    z-index: 1000;
    min-width: 200px;
}

.history-nav-panel h3 {
    margin: 0 0 10px 0;
    color: #333;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.loading-overlay.hidden { display: none; }

/* --- Stats view sidebar --- */
.stats-sidebar {
    position: absolute;
    top: 0; left: 0;
    width: 380px;
    height: 100%;
    background: rgba(255,255,255,0.96);
    overflow-y: auto;
    padding: 60px 20px 20px 20px;
    box-shadow: 2px 0 12px rgba(0,0,0,0.1);
}

.stats-section { margin-bottom: 24px; }
.stats-section h2 {
    font-size: 1.1em;
    color: #333;
    margin-bottom: 12px;
}

.stats-impact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.stats-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 16px;
    text-align: center;
}

.stats-card-icon { font-size: 1.8em; margin-bottom: 8px; }
.stats-card-value { font-size: 1.6em; font-weight: 700; color: #1a237e; }
.stats-card-label { font-size: 0.8em; color: #666; margin-top: 4px; }

.stats-gamification-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stats-record-card {
    background: linear-gradient(135deg, #fff9c4, #fff8e1);
    border: 1px solid #f9a825;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stats-record-icon { font-size: 1.5em; }
.stats-record-info { flex: 1; }
.stats-record-title { font-weight: 600; font-size: 0.85em; color: #333; }
.stats-record-value { font-size: 0.85em; color: #555; }

/* Stats heatmap controls inside sidebar */
.stats-sidebar .heatmap-controls-section input[type="date"],
.stats-sidebar .heatmap-controls-section input[type="number"] {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}

.stats-sidebar .search-btn {
    margin-top: 8px;
}

.stats-sidebar .info-panel {
    position: static;
    box-shadow: none;
    padding: 0;
    margin-top: 12px;
}

/* --- Responsive for public navbar --- */
@media (max-width: 768px) {
    .public-navbar { padding: 4px 5px; border-radius: 12px; top: 8px; }
    .navbar-brand { display: none; }
    .navbar-tab { padding: 6px 10px; font-size: 0.78em; }
    .stats-sidebar { width: 100%; height: auto; max-height: 50vh; padding-top: 20px; }
    .timeline-controls { flex-wrap: wrap; gap: 8px; }
    .timeline-date-inputs { margin-left: 0; flex-wrap: wrap; }
}









/* Conteneur principal positionné en bas à gauche */
.theme-selector {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1000; /* Assure que le bouton passe au-dessus de la carte Leaflet */
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

/* Le bouton principal carré/arrondi */
.theme-btn {
    background: white;
    border: 2px solid rgba(0,0,0,0.2);
    border-radius: 6px;
    padding: 10px 14px;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    transition: background-color 0.2s;
}

.theme-btn:hover {
    background-color: #f8f9fa;
}

/* Le menu déroulant (qui s'ouvre vers le haut) */
.theme-list {
    position: absolute;
    bottom: 100%; /* Place le menu juste au-dessus du bouton */
    left: 0;
    margin-bottom: 8px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    border: 2px solid rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    min-width: 180px;
    overflow: hidden;
    
    /* Animation fluide */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease-in-out;
}

/* Classe active pour afficher le menu */
.theme-list.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Les options à l'intérieur du menu */
.theme-option {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid #eee;
    color: #444;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.theme-preview {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    border: 1px solid rgba(0,0,0,0.18);
    flex-shrink: 0;
}

.theme-label {
    line-height: 1;
}

.theme-option:last-child {
    border-bottom: none;
}

.theme-option:hover {
    background: #f0f0f0;
}

.theme-option.active {
    background: #eef2ff;
    color: #3b82f6;
    font-weight: bold;
    border-left: 4px solid #3b82f6;
    padding-left: 11px; /* Compense la bordure pour garder le texte aligné */
}