/* ===================================
   Variables Dark Theme
   =================================== */
:root {
    --bg-dark: #0f172a;
    --bg-darker: #020617;
    --bg-card: #1e293b;
    --bg-card-hover: #334155;
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --primary-light: #60a5fa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-light: #475569;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.3), 0 2px 4px -2px rgb(0 0 0 / 0.3);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.3), 0 8px 10px -6px rgb(0 0 0 / 0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===================================
   Layout Principal
   =================================== */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* ===================================
   Sidebar réseaux sociaux (gauche)
   =================================== */
.social-sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 14px;
    overflow-y: auto;
    max-height: 100vh;
    position: sticky;
    top: 0;
    align-self: flex-start;
}

.social-sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 4px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    padding-bottom: 14px;
    margin-bottom: 2px;
}

.social-sidebar-header i {
    color: var(--primary-light);
    font-size: 1.1rem;
}

/* Carte réseau social */
.social-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

.social-card-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    font-weight: 700;
    font-size: 0.95rem;
    color: #fff;
}

.social-card-top i {
    font-size: 1.1rem;
}

.social-card-youtube   { background: #ff0000; }
.social-card-facebook  { background: #1877f2; }
.social-card-x         { background: #000; }
.social-card-instagram { background: linear-gradient(90deg, #f09433, #dc2743, #bc1888); }
.social-card-tiktok    { background: #010101; }

.social-card-desc {
    padding: 10px 14px 4px;
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 0;
}

.social-card-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    margin: 8px 14px 12px;
    padding: 7px 12px;
    border-radius: 6px;
    background: var(--bg-darker);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    width: fit-content;
}

.social-card-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Masquer sur tablette/mobile */
@media (max-width: 1200px) {
    .social-sidebar {
        display: none;
    }
}

/* ===================================
   Sidebar
   =================================== */
.sidebar {
    width: 320px;
    background: var(--bg-darker);
    border-left: 1px solid var(--border);
    display: none; /* Caché par défaut, affiché via JS quand dans une session */
    flex-direction: column;
    position: fixed;
    right: 0;
    left: auto;
    top: 0;
    bottom: 0;
    z-index: 200;
    transform: translateX(100%);
    transition: transform 0.3s ease;
}

.sidebar.show {
    transform: translateX(0);
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    height: 50px;
    width: auto;
}

.sidebar-title {
    flex: 1;
}

.sidebar-title h2 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.sidebar-title p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.sidebar-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.3s;
}

.sidebar-toggle:hover {
    background: var(--bg-card-hover);
}

.sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.sessions-sidebar-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.session-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
}

.session-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.session-item.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(37, 99, 235, 0.1));
    border-color: var(--primary);
}

.session-item.active-session::before {
    content: "●";
    color: var(--success);
    margin-right: 8px;
    font-size: 1.2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.session-item-title {
    font-weight: 700;
    color: var(--text);
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.session-item-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.session-item-meta div {
    margin-top: 3px;
}

/* ===================================
   Main Content
   =================================== */
.main-content {
    flex: 1;
    width: 100%;
    min-width: 0;
    overflow-x: hidden;
}

/* ===================================
   Header Principal
   =================================== */
.header {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    padding: 30px;
    padding-right: 70px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
}

/* Bouton burger — toujours visible */
.mobile-burger {
    display: flex;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-logo {
    height: 120px;
    width: auto;
}

.header-content h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.header-content p {
    font-size: 1rem;
    opacity: 0.9;
}

.header-actions {
    display: flex;
    gap: 10px;
}

/* ===================================
   Boutons
   =================================== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

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

.btn-secondary {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
}

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

.btn-warning:hover {
    background: #d97706;
    transform: translateY(-2px);
}

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

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* ===================================
   Container
   =================================== */
.container {
    padding: 30px;
    max-width: 1800px;
    margin: 0 auto;
    box-sizing: border-box;
    width: 100%;
}

.hidden {
    display: none !important;
}

/* ===================================
   Cartes de statistiques
   =================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stat-card {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border-radius: 12px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 25px 35px -5px rgb(0 0 0 / 0.4), 0 10px 15px -6px rgb(0 0 0 / 0.4);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.9;
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-content {
    flex: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 2px;
    transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
    transform: scale(1.1);
}

.stat-unit {
    font-size: 0.9rem;
    opacity: 0.8;
}

.stat-minmax {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: auto;
    padding-left: 15px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    opacity: 0.9;
}

.stat-max,
.stat-min {
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.stat-max {
    color: rgba(255, 255, 255, 0.95);
}

.stat-min {
    color: rgba(255, 255, 255, 0.85);
}

.stat-max i,
.stat-min i {
    font-size: 0.75rem;
    opacity: 0.7;
}

/* ===================================
   Graphiques
   =================================== */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 1400px) {
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.chart-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
}

.chart-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), transparent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.chart-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-light);
}

.chart-card:hover::before {
    transform: scaleX(1);
}

.chart-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text);
    font-weight: 600;
}

.apexcharts-canvas {
    background: transparent !important;
}

.apexcharts-tooltip {
    background: var(--bg-darker) !important;
    border: 1px solid var(--border) !important;
}

.apexcharts-tooltip-title {
    background: var(--bg-card) !important;
    border-bottom: 1px solid var(--border) !important;
}

.apexcharts-xaxistooltip,
.apexcharts-yaxistooltip {
    background: var(--bg-darker) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
}

.apexcharts-xaxistooltip:before,
.apexcharts-xaxistooltip:after {
    border-bottom-color: var(--border) !important;
}

/* ===================================
   Carte et Photos
   =================================== */
.info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Cartes avec hauteur fixe */
.info-grid .chart-card {
    height: 550px;
    display: flex;
    flex-direction: column;
}

.info-grid .chart-card h3 {
    flex-shrink: 0;
    margin-bottom: 15px;
}

.info-grid .chart-card > div {
    flex: 1;
    overflow: hidden;
}

/* Map container */
#mapContainer {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#sessionMap {
    height: 100% !important;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

#mapPlaceholder {
    height: 100% !important;
}

/* Photo gallery */
#photoGallery {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#photoGalleryContent,
#photoPlaceholder {
    height: 100%;
}

/* Style des popups Leaflet pour le dark mode */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    color: var(--text) !important;
    border: 1px solid var(--border-light) !important;
}

.leaflet-popup-tip {
    background: var(--bg-card) !important;
}

.leaflet-popup-content {
    color: var(--text) !important;
}

.leaflet-popup-content strong {
    color: var(--primary-light) !important;
}

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

.photo-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.photo-item:hover {
    transform: scale(1.05);
    border-color: var(--primary);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-badge {
    position: absolute;
    bottom: 5px;
    left: 5px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 0.8rem;
}

/* Modal photo */
.photo-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    align-items: center;
    justify-content: center;
}

.photo-modal.active {
    display: flex;
}

.photo-modal img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
}

.photo-modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.photo-modal-close:hover {
    opacity: 0.7;
}

/* ===================================
   Tableau de données
   =================================== */
.data-table-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow);
}

.data-table-card h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text);
}

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

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

.data-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

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

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

.data-table tbody tr:hover {
    background: var(--bg-card-hover);
}

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

.no-data {
    text-align: center !important;
    color: var(--text-muted);
    padding: 30px !important;
}

/* ===================================
   Toggle Sidebar (mobile)
   =================================== */
.mobile-burger {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

.mobile-burger:hover {
    background: rgba(255,255,255,0.25);
}

/* ===================================
   Loading
   =================================== */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 1.1rem;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60% { content: '...'; }
    80%, 100% { content: ''; }
}

/* ===================================
   Placeholders
   =================================== */
.placeholder {
    padding: 60px 40px;
    text-align: center;
    color: var(--text-muted);
    background: var(--bg-card);
    border: 2px dashed var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.placeholder-icon {
    font-size: 4rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.placeholder a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 600;
    margin-top: 10px;
    transition: color 0.3s;
}

.placeholder a:hover {
    color: var(--primary);
}

/* ===================================
   Badges
   =================================== */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-success {
    background: #ffffff;
    color: var(--success);
    border: 1px solid var(--success);
    animation: pulse-text-color 1.5s ease-in-out infinite;
}

@keyframes pulse-text-color {
    0%, 100% {
        color: var(--success);
    }
    50% {
        color: rgba(16, 185, 129, 0.5);
    }
}

.badge-inactive {
    background: red;
    color: #FFF;
    border: 0;
}

.badge-warning {
    background: var(--warning);
    color: #ffffff;
    border: 1px solid var(--warning);
}

/* Badge warning dans le header */
.header .badge-warning {
    margin-left: 20px;
}

/* ===================================
   Responsive
   =================================== */
/* Overlay semi-transparent derrière la sidebar */
body.sidebar-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 199;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
        width: 100%;
    }
    
    .info-grid .chart-card {
        height: 350px;
    }

    .charts-grid,
    .info-grid {
        grid-template-columns: 1fr;
        min-width: 0;
    }

    .info-grid .chart-card {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .sessions-map-layout {
        grid-template-columns: 1fr;
    }
    
    .deployments-map,
    .map-placeholder {
        height: 300px;
    }
}

@media (max-width: 640px) {
    /* Header compact sur mobile */
    .header {
        padding: 10px 12px;
        gap: 10px;
        min-height: unset;
        flex-wrap: nowrap;
        align-items: center;
    }

    .header-left {
        gap: 10px;
        flex: 1;
        min-width: 0;
        overflow: hidden;
    }

    .header-logo {
        height: 30px;
        width: auto;
        flex-shrink: 0;
    }

    .header-content {
        min-width: 0;
        flex: 1;
        overflow: hidden;
    }

    .header-content h1 {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-content p {
        font-size: 0.7rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .header-actions {
        display: flex;
        gap: 5px;
        flex-shrink: 0;
    }

    .header-actions .btn {
        padding: 6px 10px;
        font-size: 0.78rem;
    }
    
    /* Stats 2 colonnes sur mobile */
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .stat-card {
        padding: 14px;
        gap: 8px;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .stat-icon {
        font-size: 1.3rem;
        padding-top: 2px;
    }

    .stat-content {
        flex: 1;
        min-width: 0;
    }

    .stat-value {
        font-size: 1.6rem !important;
    }

    .stat-unit {
        font-size: 0.8rem;
    }

    /* Min/max passe en dessous, pleine largeur, horizontal */
    .stat-minmax {
        width: 100%;
        flex-direction: row;
        justify-content: space-between;
        border-left: none;
        border-top: 1px solid rgba(255, 255, 255, 0.2);
        padding-left: 0;
        padding-top: 8px;
        margin-left: 0;
        font-size: 0.78rem;
        gap: 0;
    }

    .stat-max,
    .stat-min {
        flex: 1;
        justify-content: center;
    }

    .stat-max {
        border-right: 1px solid rgba(255, 255, 255, 0.15);
        padding-right: 8px;
    }

    .stat-min {
        padding-left: 8px;
    }
    
    /* Container padding réduit */
    .container {
        padding: 12px;
    }
    
    /* Global stats */
    .global-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
    
    .global-stat-value {
        font-size: 1.8rem !important;
    }
    
    /* Session cards */
    .session-card-main {
        padding: 14px;
    }
    
    .session-id {
        font-size: 0.9rem;
    }
    
    .session-info-compact {
        gap: 8px;
        font-size: 0.8rem;
    }
    
    /* Charts */
    .charts-grid {
        gap: 12px;
    }
    
    .chart-card {
        padding: 14px;
    }
    
    .chart-card h3 {
        font-size: 0.9rem;
    }
    
    /* Tableau */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 6px;
    }
    

    /* Carte déploiements */
    .deployments-map,
    .map-placeholder {
        height: 250px;
    }

    /* Sessions map layout */
    .sessions-map-layout {
        gap: 15px;
    }
}

/* ===================================
   Scrollbar personnalisée
   =================================== */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

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

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

/* ===================================
   Liste des sessions (vue principale)
   =================================== */
.sessions-section {
    animation: fadeIn 0.4s ease-out;
}

/* ===================================
   Stats globales
   =================================== */
.global-stats-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.global-stats-header {
    margin-bottom: 20px;
}

.global-stats-header h2 {
    font-size: 1.5rem;
    color: var(--primary-light);
    display: flex;
    align-items: center;
    gap: 12px;
}

.global-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.global-stat-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.global-stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.global-stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-light);
}

.global-stat-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===================================
   Layout Sessions + Carte
   =================================== */
.sessions-map-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    min-height: 600px;
}

.sessions-list-column,
.sessions-map-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sessions-list-column h3,
.sessions-map-column h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.sessions-list-vertical {
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
    max-height: 700px;
    padding-right: 10px;
}

.deployments-map {
    width: 100%;
    height: 700px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.map-placeholder {
    width: 100%;
    height: 700px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    gap: 15px;
}

/* Adapter les session cards pour le listing vertical */
.sessions-list-vertical .session-card-main {
    padding: 20px;
}

@media (max-width: 1200px) {
    .sessions-map-layout {
        grid-template-columns: 1fr;
    }
    
    .deployments-map,
    .map-placeholder {
        height: 500px;
    }
}

.sessions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 20px;
}

.session-card-main {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
}

.session-card-main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.session-card-main:hover {
    border-color: var(--primary);
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.session-card-main:hover::before {
    transform: scaleX(1);
}

.session-card-main.active-session {
    border-color: var(--success);
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.05));
}

.session-card-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.session-id {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-light);
}

/* Infos compactes sous le titre */
.session-info-compact {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--border);
}

.info-compact-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.info-compact-item i {
    color: #60a5fa;
    font-size: 0.8rem;
}

.session-meta {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.meta-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.meta-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 600;
}

.session-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-item i {
    color: #60a5fa;
    font-size: 0.9rem;
    width: 16px;
    text-align: center;
}

/* Icônes dans les cartes de session et sidebar */
.session-card-main i,
.session-item-sidebar i {
    color: #60a5fa;
    margin-right: 6px;
    font-size: 0.85rem;
}

/* ===================================
   Dashboard View
   =================================== */
.dashboard-section {
    animation: fadeIn 0.4s ease-out;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.session-info-header {
    flex: 1;
}

.session-info-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.session-meta-header {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.95rem;
    color: var(--text-secondary);
}
