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

body {
    font-family: 'Outfit', sans-serif;
    background-color: #f1f5f9;
    /* Light Gray Background */
    color: #1e293b;
    /* Dark Slate Text */
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 260px;
    background-color: #1d264b;
    /* Secondary Color */
    border-right: none;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar.collapsed {
    width: 80px;
}

.sidebar.collapsed .logo span,
.sidebar.collapsed .nav-item span,
.sidebar.collapsed .user-info {
    display: none;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.5rem;
    flex-direction: column;
    gap: 1rem;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar.collapsed .nav-item a {
    justify-content: center;
    padding: 1rem;
}

.sidebar.collapsed .user-profile {
    justify-content: center;
}

.sidebar.collapsed #toggle-sidebar ion-icon {
    transform: rotate(180deg);
}

/* Tooltip on hover for collapsed sidebar (Optional but good UX) */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item:hover::after {
    content: attr(data-tooltip);
    /* We would need to add data-tooltip attribute via JS or HTML, skipping for now */
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.logo-icon {
    font-size: 1.8rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1.5rem 0;
    overflow-y: auto;
}

.sidebar-nav ul {
    list-style: none;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.5rem;
    color: #cbd5e1;
    /* Lighter text for dark sidebar */
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item a:hover,
.nav-item.active a {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border-left-color: #ffb000;
}

.nav-item ion-icon {
    font-size: 1.4rem;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-info .name {
    font-weight: 600;
    font-size: 0.9rem;
    color: #ffffff;
}

.user-info .role {
    font-size: 0.8rem;
    color: #94a3b8;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #f1f5f9;
    /* White/Light Main Background */
}

.top-bar {
    height: auto;
    padding: 0;
    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    border-bottom: none;
    background: transparent;
    position: fixed;
    top: 1rem;
    right: 2rem;
    z-index: 100;
}

.top-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* Buttons */
.btn-primary {
    background: #ffb000;
    color: #ffffff;
    /* White text on buttons usually looks cleaner, or dark blue #1d264b if low contrast */
    color: #ffffff;
    /* Using dark blue for high contrast on yellow/orange */
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-secondary {
    background: white;
    border: 1px solid #cbd5e1;
    color: #475569;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.btn-secondary:hover {
    border-color: #94a3b8;
    color: #1e293b;
    background: #f8fafc;
}

/* Style pour le bouton Supprimer */
.btn-delete {
    background: transparent;
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 0.6rem 1.2rem;
    border-radius: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 600;
}

.btn-delete:hover {
    background: #ef4444;
    color: #ef4444;
    border-color: #ef4444;
    transform: translateY(-1px);
}


.icon-btn {
    background: none;
    border: none;
    color: #1e293b;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    padding: 0.5rem;
    border-radius: 9999px;
    transition: all 0.3s ease;
}

.icon-btn:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #334155;
}

.badge {
    position: absolute;
    top: 0;
    right: 0;
    background-color: #ef4444;
    color: white;
    font-size: 0.7rem;
    padding: 2px 5px;
    border-radius: 9999px;
}

/* View Container */
.view-container {
    flex: 1;
    overflow-y: auto;
    padding: 2rem;
}

.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 1.8rem;
    font-weight: 700;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* Soft shadow for light mode */
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #1d264b;
    /* Updated to dark blue */
}

.stat-title {
    color: #94a3b8;
    font-size: 0.9rem;
    font-weight: 500;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
}

.stat-trend {
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 4px;
}

.trend-up {
    color: #10b981;
}

.trend-down {
    color: #ef4444;
}

/* Sub-trends for Conversion Rate split */
.stat-sub-trends {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 8px;
}

.sub-trend {
    color: #64748b;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
}

.sub-trend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.sub-trend-dot.paris {
    background: #3b82f6;
    /* Bleu */
}

.sub-trend-dot.marseille {
    background: #10b981;
    /* Vert */
}


.charts-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid-halves {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.charts-grid-thirds {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Comparison Grid for Scped Distributions */
.comparison-grid {
    display: grid;
    gap: 1.5rem;
    transition: all 0.3s ease;
}

.comparison-grid.collapsed {
    grid-template-columns: minmax(auto, 600px);
    justify-content: center;
}

.comparison-grid.expanded {
    grid-template-columns: 1fr 1fr 1fr;
}

.scope-column {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.scope-column h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: #1e293b;
    font-size: 1.2rem;
    font-weight: 600;
}

.comparison-grid.collapsed .city-column {
    display: none;
}

@media (max-width: 900px) {
    .charts-grid-thirds {
        grid-template-columns: 1fr;
    }

    .comparison-grid.expanded {
        grid-template-columns: 1fr;
        /* Stack on smaller screens */
    }
}

/* Horizontal Bar Chart Styles */
.bar-chart-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    overflow-y: auto;
    padding-right: 0.5rem;
    max-height: 300px;
}

.bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.bar-label {
    width: 140px;
    font-size: 0.8rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: right;
    flex-shrink: 0;
}

.bar-track {
    flex: 1;
    background-color: #f1f5f9;
    height: 8px;
    /* Thinner bars for elegance */
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
}

.bar-fill {
    height: 100%;
    background-color: #1d264b;
    /* Default Dark Blue */
    border-radius: 4px;
    width: 0;
    /* Animated to width */
    transition: width 1s ease-out;
}

.bar-fill.sector-fill {
    background-color: #ffb000;
    /* Yellow for Sector */
}

.bar-value {
    width: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    margin-left: 0.5rem;
    flex-shrink: 0;
}


.chart-card {
    background-color: #ffffff;
    padding: 1.5rem;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    min-height: 380px;
    /* Increased min-height for stacked layout */
    height: auto;
    /* Allow growth */
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.chart-header {
    width: 100%;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e293b;
    text-align: left;
    /* Keep title left-aligned */
}

/* Donut Chart Styles */
.donut-chart-wrapper {
    display: flex;
    flex-direction: column;
    /* Stack visual and legend */
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    width: 100%;
    height: 100%;
    padding-bottom: 0.5rem;
}

.donut-visual {
    width: 160px;
    /* Slightly reduced size */
    height: 160px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    /* Gradient applied via inline style */
}

.donut-hole {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100px;
    /* Adjusted for new donut size */
    height: 100px;
    background: #ffffff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.donut-total {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
}

.donut-label {
    font-size: 0.75rem;
    color: #94a3b8;
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    max-height: 220px;
    overflow-y: auto;
    width: 100%;
}

.legend-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #475569;
    padding-right: 0.5rem;
}

.legend-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.legend-value {
    font-weight: 600;
    color: #1e293b;
}


/* Pagination (compact — libère de la place pour afficher ~2 lignes de plus) */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0.75rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 0.75rem 0.75rem;
    margin-top: 0 !important;
}
.pagination-controls .btn-secondary {
    padding: 0.2rem 0.6rem !important;
    font-size: 0.8rem;
}
.pagination-controls select {
    padding: 0.15rem 0.3rem !important;
    font-size: 0.8rem;
}

/* Tables */
.table-container {
    background-color: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    /* MODIFICATION CLÉ 1 : Autoriser le défilement horizontal et vertical */
    overflow: auto;
    /* Limite la hauteur pour forcer le scroll et activer le sticky header */
    max-height: calc(100vh - 180px);
    scroll-behavior: smooth;
    position: relative;
}

table {
    width: 100%;
    border-collapse: collapse;
    /* MODIFICATION CLÉ 2 : Force la largeur minimale du tableau pour activer le défilement */
    min-width: 1200px;
}

th,
td {
    /* Densité compacte : on divise le padding vertical par 2.5 et on réduit
       la taille de police pour afficher plus de lignes en une vue. */
    padding: 0.4rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
    color: #334155;
    font-size: 0.82rem;
    line-height: 1.25;
}

th {
    background-color: #ffffff;
    /* Sticky Header White */
    font-weight: 600;
    color: #64748b;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    position: sticky;
    top: 0;
    z-index: 20;
    box-shadow: 0 1px 0 #e2e8f0;
    padding: 0.45rem 0.75rem;
}

/* Compacte aussi les contrôles inline qu'on trouve dans les cellules
   (checkboxes, selects de statut, boutons d'action) pour ne pas gonfler
   la hauteur des lignes malgré le padding réduit. */
td .btn-icon,
td button.btn-icon {
    padding: 0.1rem 0.2rem !important;
    font-size: 0.85rem !important;
    line-height: 1 !important;
}
td .btn-icon ion-icon,
td button.btn-icon ion-icon {
    font-size: 0.95rem !important;
    vertical-align: middle;
}
td.actions-col {
    padding-top: 0.2rem !important;
    padding-bottom: 0.2rem !important;
    white-space: nowrap;
}
.text-red, .text-red ion-icon { color: #ef4444 !important; }
.text-red:hover { background: rgba(239, 68, 68, 0.08) !important; }

 tr:last-child td {
    border-bottom: none;
}

tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
    /* Light hover effect */
}

td a {
    color: #ffb000;
    /* Link color matching buttons */
}


/* Badges de statut des Contacts */
.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}

.status-lead {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}

.status-client {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.status-prospect {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.badge-resign {
    background-color: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    margin-top: 0.2rem;
    display: inline-block;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: slideIn 0.3s ease;
    color: #1e293b;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.close-modal {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.5rem;
    cursor: pointer;
}

.hidden {
    display: none !important;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 0.75rem;
    color: #1e293b;
    font-family: inherit;
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #ffb000;
    background-color: #ffffff;
}

.form-actions {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

/* Pour les boutons de Study-modal (Annuler, Enregistrer, Supprimer): */
.form-actions button:not(.btn-delete) {
    /* Marge entre Annuler et Enregistrer */
    margin-left: 1rem;
}

.form-actions .btn-secondary {
    /* Remet la marge à zéro pour Annuler si c'est le premier du groupe de droite */
    margin-left: 0;
}


/* SVG Charts Placeholders */
.bar-chart-placeholder {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    width: 100%;
    padding: 0 20px;
}

.bar {
    flex: 1;
    background: #1d264b;
    border-radius: 4px 4px 0 0;
    opacity: 1;
    transition: height 1s ease;
    height: 0;
}

.donut-chart-container {
    position: relative;
    width: 150px;
    height: 150px;
}

svg.donut {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

circle.donut-ring {
    fill: none;
    stroke: #e2e8f0;
    /* Light gray base */
    stroke-width: 20;
}

circle.donut-segment {
    fill: none;
    stroke: #1d264b;
    /* Dark Blue active segment */
    stroke-width: 20;
    stroke-dasharray: 0 100;
    transition: stroke-dasharray 1s ease;
}


/*
 * --------------------------------
 * AJOUTS POUR LE PIPELINE (Deal Status Badges)
 * --------------------------------
 */

/* Style de base pour les badges de statut de Deal */
.deal-status-badge {
    padding: 0.3rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
}

/* Statut : Pipeline (Couleur neutre/primaire claire) */
.deal-status-badge[data-stage="Pipeline"] {
    background-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* Statut : Stand by (Couleur de Mise en Garde/Warning) */
.deal-status-badge[data-stage="Stand by"] {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

/* Statut : En attente de paiement (Couleur secondaire/rose) */
.deal-status-badge[data-stage="En attente de paiement"] {
    background-color: rgba(236, 72, 153, 0.2);
    color: #ec4899;
}

/* Statut : Terminé (Succès) */
.deal-status-badge[data-stage="Terminé"] {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
    font-weight: 700;
}

/* --- NOUVELLES ÉTAPES CEG --- */

/* Étape 1 : CEG à faire (Début du processus actif) */
.deal-status-badge[data-stage="CEG à faire"] {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

/* Étape 2 : CEG à valider (Validation en cours) */
.deal-status-badge[data-stage="CEG à valider"] {
    background-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

/* Étape 3 : CEG à payer (Action critique/Proche de la fin) */
.deal-status-badge[data-stage="CEG à payer"] {
    background-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    font-weight: 600;
}


/* ============================================
 * NOTIFICATIONS SYSTEM
 * ============================================
 */

.notifications-panel {
    position: fixed;
    top: 60px;
    right: 20px;
    width: 400px;
    max-height: 600px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

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

.notifications-header {
    padding: 1rem 1.5rem;
    background: #1d264b;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    margin: 0;
    font-size: 1.1rem;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notifications-list {
    max-height: 500px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    transition: background 0.2s;
}

.notification-item:hover {
    background: #f9fafb;
}

.notification-item.unread {
    background: #eff6ff;
    border-left: 4px solid #6366f1;
}

.notification-item.read {
    opacity: 0.7;
}

.notification-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: #1f2937;
}

.notification-content p {
    margin: 0 0 0.5rem 0;
    color: #6b7280;
    font-size: 0.9rem;
}

.notification-content small {
    color: #9ca3af;
    font-size: 0.8rem;
}

.mark-read-btn {
    background: #6366f1;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s;
}

.mark-read-btn:hover {
    background: #4f46e5;
}

.no-notifications {
    padding: 2rem;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* Badge de notification */
#notification-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: bold;
    border: 2px solid white;
}
    font-size: 1.1rem;
}

/* Notifications Panel */
.top-actions {
    position: relative;
}

.notifications-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 380px;
    max-height: 500px;
    background-color: #0f172a;
    border: 1px solid #334155;
    border-radius: 1rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    overflow: hidden;
    animation: slideDown 0.3s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.notifications-header {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.notifications-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.btn-clear-all {
    background: none;
    border: none;
    color: #6366f1;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.3rem 0.6rem;
    border-radius: 0.5rem;
    transition: all 0.3s ease;
}

.btn-clear-all:hover {
    background-color: rgba(99, 102, 241, 0.1);
}

.notifications-list {
    max-height: 400px;
    overflow-y: auto;
}

.notification-item {
    padding: 1.5rem;
    border-bottom: 1px solid #334155;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    gap: 1rem;
}

.notification-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

.notification-item:last-child {
    border-bottom: none;
}

.notification-item.unread {
    background-color: rgba(99, 102, 241, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-icon.activity {
    background-color: rgba(99, 102, 241, 0.2);
    color: #6366f1;
}

.notification-icon.reminder {
    background-color: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.notification-icon.deal {
    background-color: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.2rem;
}

.notification-message {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 0.3rem;
}

.notification-time {
    font-size: 0.75rem;
    color: #94a3b8;
}

.notifications-empty {
    padding: 3rem;
    text-align: center;
    color: #94a3b8;
}

.notifications-empty ion-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Sticky Headers Logic */
.filter-row-inputs th {
    position: sticky;
    top: 45px;
    z-index: 20;
    box-shadow: 0 1px 0 #e2e8f0;
    background-color: #f8fafc;
}

thead tr:first-child th {
    z-index: 30;
}

/* --- STACKED BAR CHART (REFINED) --- */
.chart-container-stacked {
    width: 100%;
    background: #fff;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chart-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0;
}

.stacked-graph-container {
    width: 100%;
    position: relative;
    margin-top: 1rem;
}

.stacked-graph {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    position: relative;
    z-index: 10;
}

.bar-group-wrapper {
    position: relative;
    transition: transform 0.2s;
}

.bar-group-wrapper:hover {
    transform: translateY(-5px);
}

.monthly-bar-clickable:hover {
    transform: translateY(-5px) scale(1.05);
}

.monthly-bar-clickable:hover .bar-group {
    box-shadow: 0 6px 12px -1px rgba(0, 0, 0, 0.2);
}

.bar-group {
    display: flex;
    flex-direction: column;
    /* Stack Top to Bottom in DOM */
    justify-content: flex-start;
    /* Items start at top */
    /* Wait, we want Paris (Top) and Marseille (Bottom). 
       In flex-col:
       Item 1
       Item 2
       So if we put Paris first in HTML, it is top. Marseille second is bottom.
       This matches the App.js logic. */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
}

.bar-segment {
    width: 100%;
    transition: height 0.6s ease-out;
}

/* Colors specifically requested */
/* Marseille : bleu moderne -> #3b82f6 (Bright Blue) */
/* Paris : au-dessus -> #1e293b (Dark Slate / Navy) */
.bar-segment.marseille {
    background-color: #3b82f6;
    /* Blue 500 */
}

.bar-segment.paris {
    background-color: #1e293b;
    /* Slate 800 */
}

/* Legend dots */
.bg-marseille {
    background-color: #3b82f6;
}

.bg-paris {
    background-color: #1e293b;
}

.bar-label {
    font-size: 0.85rem;
    color: #64748b;
    font-weight: 500;
    text-align: center;
}

/* Custom Tooltip using data-tooltip-html */
/* Custom HTML Tooltip Container */
/* The tooltip is injected as a child element .chart-tooltip inside .bar-group-wrapper via JS */

.chart-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background-color: #1e293b;
    color: #fff;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.8rem;
    z-index: 50;
    min-width: 180px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    pointer-events: none;
    text-align: left;
}

.bar-group-wrapper:hover .chart-tooltip {
    opacity: 1;
    visibility: visible;
}

.chart-legend-inline {
    display: flex;
    align-items: center;
}

.legend-item {
    font-weight: 500;
    font-size: 0.9rem;
}
/* Shared Components */
.link-clickable {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}
.link-clickable:hover {
    text-decoration: underline;
    color: #2563eb;
}

/* ============================================================
   Bouton de déconnexion (sidebar footer) — ROUGE PLEIN
   On force la couleur via !important car certains styles
   génériques de .icon-btn pourraient sinon la recouvrir.
   ============================================================ */
.logout-action,
a.logout-action,
.sidebar .logout-action {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    color: #ffffff !important;
    background: #ef4444 !important;
    border: none;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
    transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.logout-action ion-icon,
a.logout-action ion-icon {
    font-size: 1.2rem;
    color: #ffffff !important;
}
.logout-action:hover,
a.logout-action:hover {
    background: #dc2626 !important;
    transform: scale(1.08);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
}

/* ============================================================
   Bouton de rétractation de la sidebar — ICÔNE BLANCHE
   ============================================================ */
#toggle-sidebar,
button#toggle-sidebar {
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.15s ease, transform 0.15s ease;
}
#toggle-sidebar ion-icon {
    color: #ffffff !important;
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}
#toggle-sidebar:hover {
    background: rgba(255, 255, 255, 0.25) !important;
    transform: scale(1.05);
}

/* ============================================================
   Top bar — on a retiré le titre, on garde juste les actions.
   Barre plus fine pour laisser la place au contenu.
   ============================================================ */
.top-bar {
    justify-content: flex-end !important;
}

