/* ==========================================
   CNGI Platform - Main Stylesheet
   ========================================== */

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

/* Les variables CSS (--primary-color, --bg-color, etc.) sont désormais
   définies et aliasées dans public/css/tokens.css chargé avant ce fichier.
   Single source of truth + prêt pour un toggle dark mode futur. */

@import url('https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;600;700&family=Roboto+Slab:wght@300;400;500&display=swap');

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

/* ==========================================
   SIDEBAR
   ========================================== */

.sidebar {
    width: 270px;
    background: linear-gradient(180deg, #1a2249 0%, #202B5D 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.sidebar.show {
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-header .logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 10px;
}

.sidebar-header .logo-container img {
    height: 44px;
    width: auto;
}

.sidebar-header .app-title {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.95);
}

.sidebar-header .app-subtitle {
    font-size: 11px;
    color: var(--accent-water);
    font-weight: 500;
    margin-top: 2px;
}

.sidebar-header h2 {
    font-size: 22px;
    margin-bottom: 5px;
    font-weight: 700;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.7;
}

.sidebar-section-label {
    padding: 18px 24px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.35);
}

.sidebar-menu {
    padding: 20px 0;
}

.menu-item {
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border-left: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
}

.menu-item:hover {
    background: rgba(55, 148, 196, 0.12);
    color: white;
    border-left-color: rgba(55, 148, 196, 0.4);
}

.menu-item.active {
    background: rgba(55, 148, 196, 0.18);
    color: white;
    border-left-color: var(--accent-water);
}

.menu-item .menu-item-icon {
    color: var(--accent-water);
    opacity: 0.7;
}

.menu-item.active .menu-item-icon {
    opacity: 1;
}

.menu-item-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

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

.logout-btn {
    padding: 10px 20px;
    background: rgba(231, 76, 60, 0.15);
    border: 1px solid rgba(231, 76, 60, 0.3);
    color: #f5a5a0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    width: 100%;
    font-size: 13px;
    font-weight: 600;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 0.25);
    color: #ff8a80;
}

/* ==========================================
   ALERT BANNER (Dashboard)
   ========================================== */

.alert-banner {
    background: linear-gradient(90deg, #fff3e0, #fff8e1);
    border: 1px solid #ffe0b2;
    border-left: 4px solid #f39c12;
    border-radius: 8px;
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.alert-banner-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-banner-content {
    flex: 1;
    font-size: 14px;
    color: #795548;
    font-weight: 500;
}

.alert-banner-content strong {
    color: #e65100;
}

/* ==========================================
   SIDEBAR with-sidebar adjustment
   ========================================== */

.main-content.with-sidebar {
    margin-left: 270px;
}

/* ==========================================
   MAIN CONTENT
   ========================================== */

.main-content {
    margin-left: 0;
    flex: 1;
    min-height: 100vh;
}

.main-content.with-sidebar {
    margin-left: 270px;
}

.top-bar {
    background: white;
    padding: 20px 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-bar h1 {
    font-size: 28px;
    color: var(--primary-color);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, #202B5D 0%, #3794C4 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 15px;
}

.user-info {
    text-align: right;
}

.user-name {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-medium);
}

.content-area {
    padding: 40px;
}

/* ==========================================
   METRICS / STATS
   ========================================== */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.metric-value {
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 8px;
}

.metric-card:nth-child(1) .metric-value { color: #202B5D; }
.metric-card:nth-child(2) .metric-value { color: #f39c12; }
.metric-card:nth-child(3) .metric-value { color: #3794C4; }
.metric-card:nth-child(4) .metric-value { color: #27ae60; }
.metric-card:nth-child(5) .metric-value { color: #e74c3c; }

.metric-card {
    border-top: 3px solid transparent;
}
.metric-card:nth-child(1) { border-top-color: #202B5D; }
.metric-card:nth-child(2) { border-top-color: #f39c12; }
.metric-card:nth-child(3) { border-top-color: #3794C4; }
.metric-card:nth-child(4) { border-top-color: #27ae60; }
.metric-card:nth-child(5) { border-top-color: #e74c3c; }

.metric-label {
    font-size: 14px;
    color: var(--text-medium);
    font-weight: 500;
}

/* ==========================================
   BUTTONS
   ========================================== */

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(42, 82, 152, 0.3);
}

.btn-secondary {
    background: var(--border-color);
    color: var(--text-dark);
}

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

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

.btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    background: #f5f5f5;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.btn-icon:hover {
    background: #e0e0e0;
}

/* ==========================================
   FORMS
   ========================================== */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    color: var(--text-dark);
    font-weight: 500;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(42, 82, 152, 0.1);
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

select.form-control {
    cursor: pointer;
}

/* ==========================================
   TABLES
   ========================================== */

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: #f8f9fa;
}

th {
    padding: 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 14px;
    border-bottom: 2px solid var(--border-color);
}

td {
    padding: 16px;
    border-bottom: 1px solid #f0f0f0;
    color: var(--text-medium);
    font-size: 14px;
}

tbody tr:hover {
    background: #f8f9fa;
}

/* ==========================================
   CARDS
   ========================================== */

.card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
}

.card-header {
    margin-bottom: 20px;
}

.card-header h2 {
    font-size: 20px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.card-header p {
    color: var(--text-medium);
    font-size: 14px;
}

/* ==========================================
   PROJECT CARDS
   ========================================== */

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.project-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 24px;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.project-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.project-structure {
    display: inline-block;
    padding: 4px 12px;
    background: #e3f2fd;
    color: #1976d2;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.project-description {
    color: var(--text-medium);
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.project-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-medium);
}

.project-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

/* ==========================================
   STATUS BADGES
   ========================================== */

.status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
}

.status-demarrage {
    background: #fff3e0;
    color: #e65100;
}

.status-en-cours {
    background: #e3f2fd;
    color: #1976d2;
}

.status-termine {
    background: #e8f5e9;
    color: #388e3c;
}

.status-retard {
    background: #ffebee;
    color: #d32f2f;
}

.status-annule {
    background: #f5f5f5;
    color: #757575;
}

/* ==========================================
   PROGRESS BAR
   ========================================== */

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--info-color), var(--success-color));
    transition: width 0.3s;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.progress-label {
    color: var(--text-medium);
    font-weight: 500;
}

.progress-value {
    color: var(--primary-color);
    font-weight: 700;
}

/* ==========================================
   TOOLBAR
   ========================================== */

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

.search-filter {
    display: flex;
    gap: 15px;
    flex: 1;
    max-width: 600px;
}

.search-box {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
}

.filter-select {
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

/* ==========================================
   LOGIN PAGE
   ========================================== */

.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #1a2249 0%, #202B5D 50%, #2d5f8a 100%);
    padding: 20px;
}

.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 420px;
    padding: 50px 40px;
}

.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo-section h1 {
    color: var(--primary-color);
    font-size: 32px;
    margin-bottom: 8px;
    font-weight: 700;
}

.logo-section p {
    color: var(--text-medium);
    font-size: 14px;
}

/* ==========================================
   ALERTS / MESSAGES
   ========================================== */

.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background: #e8f5e9;
    color: #388e3c;
}

.alert-error {
    background: #ffebee;
    color: #d32f2f;
}

.alert-info {
    background: #e3f2fd;
    color: #1976d2;
}

.alert-warning {
    background: #fff3e0;
    color: #f57c00;
}

/* ==========================================
   LOADING SPINNER
   ========================================== */

.loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* Water spinner — séquence 5 étapes : Sunu Nawét → goutte → pluie → caniveau → motopompe */
.water-spinner { position: relative; width: 260px; height: 160px; }
.water-spinner .ws-stage { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.water-spinner .ws-stage-intro { animation: ws-intro 30s linear forwards; }
.water-spinner .ws-stage-1 { animation: ws-stage1 30s linear forwards; }
.water-spinner .ws-stage-2 { animation: ws-stage2 30s linear forwards; }
.water-spinner .ws-stage-3 { animation: ws-stage3 30s linear forwards; }
.water-spinner .ws-stage-4 { animation: ws-stage4 30s linear forwards; }
@keyframes ws-intro  { 0%, 8%  { opacity: 1; } 10%, 100% { opacity: 0; } }
@keyframes ws-stage1 { 0%, 9%  { opacity: 0; } 11%, 31% { opacity: 1; } 34%, 100% { opacity: 0; } }
@keyframes ws-stage2 { 0%, 32% { opacity: 0; } 35%, 58% { opacity: 1; } 61%, 100% { opacity: 0; } }
@keyframes ws-stage3 { 0%, 59% { opacity: 0; } 62%, 82% { opacity: 1; } 85%, 100% { opacity: 0; } }
@keyframes ws-stage4 { 0%, 83% { opacity: 0; } 86%, 100% { opacity: 1; } }

/* Stage Intro — "Sunu Nawét" */
.water-spinner .sunu-title {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 44px;
    font-weight: 700;
    color: #202B5D;
    letter-spacing: 2px;
    text-align: center;
    text-shadow: 0 2px 6px rgba(55,148,196,0.25);
    animation: ws-intro-scale 2.5s ease-out both;
    white-space: nowrap;
}
.water-spinner .sunu-title .accent { color: #3794C4; }
@keyframes ws-intro-scale {
    0% { transform: scale(0.6); opacity: 0; letter-spacing: 0; }
    50% { transform: scale(1.05); opacity: 1; letter-spacing: 3px; }
    100% { transform: scale(1); opacity: 1; letter-spacing: 2px; }
}

/* Stage 1 — Goutte + ondes */
.water-spinner .drop-wrap { position: relative; width: 80px; height: 100px; }
.water-spinner .drop {
    position: absolute; left: 50%; top: 0; transform: translateX(-50%);
    width: 16px; height: 22px; background: #3794C4;
    border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
    animation: ws-drop-fall 1.6s infinite ease-in;
    filter: drop-shadow(0 2px 4px rgba(55,148,196,0.4));
}
.water-spinner .drop::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.5), transparent 60%);
    border-radius: inherit;
}
.water-spinner .ripple {
    position: absolute; bottom: 8px; left: 50%; transform: translate(-50%, 0);
    width: 8px; height: 8px; border-radius: 50%;
    border: 2px solid #3794C4; opacity: 0;
    animation: ws-ripple-exp 1.6s infinite;
}
.water-spinner .ripple.r2 { animation-delay: 0.2s; }
.water-spinner .ripple.r3 { animation-delay: 0.4s; }
@keyframes ws-drop-fall {
    0% { top: -4px; opacity: 0; transform: translateX(-50%) scaleY(0.6); }
    15% { opacity: 1; }
    55% { top: 68px; transform: translateX(-50%) scaleY(1.1); opacity: 1; }
    65% { top: 72px; transform: translateX(-50%) scaleY(0.4); opacity: 0; }
    100% { top: 72px; opacity: 0; }
}
@keyframes ws-ripple-exp {
    0%, 55% { width: 8px; height: 8px; opacity: 0; border-width: 2px; }
    60% { opacity: 0.8; }
    100% { width: 70px; height: 18px; opacity: 0; border-width: 1px; }
}

/* Stage 2 — Pluie + flaque */
.water-spinner .rain-wrap { position: relative; width: 120px; height: 100px; }
.water-spinner .rain-drop {
    position: absolute; top: 0; width: 3px; height: 14px;
    background: linear-gradient(180deg, #3794C4, transparent);
    border-radius: 2px;
    animation: ws-rain-fall 1s linear infinite;
}
.water-spinner .rain-drop:nth-child(1) { left: 15%; animation-delay: 0s; }
.water-spinner .rain-drop:nth-child(2) { left: 35%; animation-delay: 0.3s; }
.water-spinner .rain-drop:nth-child(3) { left: 55%; animation-delay: 0.6s; }
.water-spinner .rain-drop:nth-child(4) { left: 75%; animation-delay: 0.15s; }
.water-spinner .rain-drop:nth-child(5) { left: 90%; animation-delay: 0.5s; }
.water-spinner .puddle {
    position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%);
    width: 100px; height: 12px; border-radius: 50%;
    background: radial-gradient(ellipse at center, #3794C4 0%, #202B5D 100%);
    animation: ws-puddle-ripple 1s ease-in-out infinite;
}
@keyframes ws-rain-fall {
    0% { top: -10px; opacity: 0; }
    20% { opacity: 1; }
    80% { opacity: 1; }
    100% { top: 74px; opacity: 0; }
}
@keyframes ws-puddle-ripple {
    0%, 100% { transform: translateX(-50%) scaleX(1); }
    50% { transform: translateX(-50%) scaleX(1.1); }
}

/* Stage 3 — Caniveau horizontal (infrastructure) */
.water-spinner .gut-stage { position: relative; width: 240px; height: 100px; }
.water-spinner .gut-street { position: absolute; left: 0; right: 0; top: 20px; height: 10px; background: linear-gradient(180deg, #a8a8a8, #6c7a96); }
.water-spinner .gut-street::after { content: ''; position: absolute; left: 0; right: 0; top: -2px; height: 2px; background: repeating-linear-gradient(90deg, transparent 0 6px, #fff 6px 12px); opacity: 0.4; }
.water-spinner .gut-channel { position: absolute; left: 0; right: 0; top: 30px; height: 36px; background: #3a4a66; border-top: 2px solid #202B5D; box-shadow: inset 0 4px 6px rgba(0,0,0,0.3); overflow: hidden; }
.water-spinner .gut-water { position: absolute; left: 0; right: 48px; top: 8px; bottom: 4px; background: linear-gradient(180deg, #3794C4 0%, #202B5D 100%); border-radius: 2px; }
.water-spinner .gut-water::before { content: ''; position: absolute; inset: 0; background-image: repeating-linear-gradient(90deg, transparent 0 12px, rgba(255,255,255,0.25) 12px 18px); animation: ws-gut-flow 0.5s linear infinite; }
.water-spinner .gut-water::after { content: ''; position: absolute; left: 0; right: 0; top: -3px; height: 5px; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 5'><path d='M0 2.5 Q5 0 10 2.5 T20 2.5 V5 H0 Z' fill='%233794C4'/></svg>"); background-size: 20px 5px; animation: ws-gut-wave 0.8s linear infinite; }
@keyframes ws-gut-flow { to { background-position: -18px 0; } }
@keyframes ws-gut-wave { to { background-position: -20px 0; } }
.water-spinner .gut-drain { position: absolute; right: 0; top: 30px; width: 48px; height: 36px; background: radial-gradient(ellipse at center left, #000 0%, #202B5D 60%, #3a4a66 100%); border-top: 2px solid #202B5D; border-left: 2px solid #202B5D; border-radius: 0 0 0 12px; }
.water-spinner .gut-drain::before { content: ''; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 36px; height: 20px; background: repeating-linear-gradient(0deg, #3a4a66 0 3px, #202B5D 3px 6px); border-radius: 2px; opacity: 0.7; }
.water-spinner .gut-suck { position: absolute; right: 24px; top: 44px; width: 6px; height: 10px; background: #3794C4; border-radius: 50%; opacity: 0; animation: ws-gut-suck 0.8s linear infinite; }
.water-spinner .gut-suck.s2 { animation-delay: 0.25s; }
.water-spinner .gut-suck.s3 { animation-delay: 0.5s; }
@keyframes ws-gut-suck {
    0% { transform: translate(0, 0) scale(1); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(36px, 0) scale(0.2); opacity: 0; }
}

/* Stage 4 — Motopompe */
.water-spinner .mp-stage { position: relative; width: 220px; height: 110px; }
.water-spinner .mp-flood {
    position: absolute; left: 0; bottom: 0; width: 70px; height: 28px;
    background: linear-gradient(180deg, #3794C4, #202B5D);
    border-radius: 0 8px 0 0;
    animation: ws-mp-flood-drop 3s ease-in-out infinite;
    overflow: hidden;
}
.water-spinner .mp-flood::before {
    content: ''; position: absolute; left: 0; right: 0; top: -4px; height: 6px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 6'><path d='M0 3 Q7.5 0 15 3 T30 3 V6 H0 Z' fill='%233794C4'/></svg>");
    background-size: 30px 6px;
    animation: ws-mp-wave-move 1s linear infinite;
}
@keyframes ws-mp-wave-move { from { background-position: 0 0; } to { background-position: -30px 0; } }
.water-spinner .mp-intake-hose {
    position: absolute; left: 55px; bottom: 20px; width: 40px; height: 8px;
    background: repeating-linear-gradient(90deg, #3a4a66 0 4px, #6c7a96 4px 8px);
    border-radius: 4px; transform: rotate(-18deg); transform-origin: left center;
    z-index: 2;
}
.water-spinner .mp-body {
    position: absolute; left: 90px; bottom: 18px; width: 78px; height: 46px;
    background: linear-gradient(180deg, #e74c3c 0%, #c0392b 60%, #8b1e10 100%);
    border: 2px solid #202B5D; border-radius: 6px;
    box-shadow: inset 0 -6px 0 rgba(0,0,0,0.15);
    animation: ws-mp-vibrate 0.12s linear infinite;
    z-index: 3;
}
.water-spinner .mp-engine {
    position: absolute; left: 102px; bottom: 58px; width: 40px; height: 14px;
    background: #3a4a66; border: 2px solid #202B5D; border-radius: 3px 3px 2px 2px;
    animation: ws-mp-vibrate 0.12s linear infinite;
    z-index: 4;
}
.water-spinner .mp-engine::after {
    content: ''; position: absolute; left: 6px; right: 6px; top: 2px; bottom: 2px;
    background: repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,0.2) 3px 5px);
}
.water-spinner .mp-exhaust {
    position: absolute; left: 138px; bottom: 70px; width: 6px; height: 10px;
    background: #6c7a96; border-radius: 2px; z-index: 4;
}
.water-spinner .mp-smoke {
    position: absolute; left: 137px; bottom: 78px; width: 10px; height: 10px;
    background: #c8c8c8; border-radius: 50%; opacity: 0;
    animation: ws-mp-smoke-rise 1.4s ease-out infinite;
    z-index: 5;
}
.water-spinner .mp-smoke.s2 { animation-delay: 0.45s; }
.water-spinner .mp-smoke.s3 { animation-delay: 0.9s; }
.water-spinner .mp-wheel {
    position: absolute; bottom: 4px; width: 18px; height: 18px; border-radius: 50%;
    background: radial-gradient(circle, #6c7a96 30%, #202B5D 35%, #202B5D 100%);
    border: 2px solid #202B5D; z-index: 2;
}
.water-spinner .mp-wheel.w1 { left: 98px; }
.water-spinner .mp-wheel.w2 { left: 148px; }
.water-spinner .mp-discharge-hose {
    position: absolute; left: 168px; bottom: 32px; width: 30px; height: 8px;
    background: repeating-linear-gradient(90deg, #3a4a66 0 4px, #6c7a96 4px 8px);
    border-radius: 4px; z-index: 2;
}
.water-spinner .mp-jet {
    position: absolute; left: 198px; bottom: 28px; width: 4px; height: 4px;
    background: #3794C4; border-radius: 50%;
    animation: ws-mp-jet-fly 0.6s linear infinite;
}
.water-spinner .mp-jet.j2 { animation-delay: 0.15s; }
.water-spinner .mp-jet.j3 { animation-delay: 0.3s; }
.water-spinner .mp-jet.j4 { animation-delay: 0.45s; }
@keyframes ws-mp-vibrate {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(0.5px, -0.5px); }
}
@keyframes ws-mp-flood-drop { 0% { height: 40px; } 100% { height: 8px; } }
@keyframes ws-mp-smoke-rise {
    0% { transform: translate(0, 0) scale(0.4); opacity: 0; }
    20% { opacity: 0.7; }
    100% { transform: translate(6px, -24px) scale(1.6); opacity: 0; }
}
@keyframes ws-mp-jet-fly {
    0% { transform: translate(0, 0); opacity: 0; }
    20% { opacity: 1; }
    100% { transform: translate(16px, 14px); opacity: 0; }
}

.loading-overlay-water { flex-direction: column; gap: 16px; }
.loading-overlay-water .water-spinner-label {
    color: #202B5D;
    font-weight: 600;
    font-size: 14px;
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

/* ==========================================
   RESPONSIVE
   ========================================== */

@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }
    
    .main-content, .main-content.with-sidebar {
        margin-left: 0;
    }
    
    .content-area {
        padding: 20px;
    }
    
    .top-bar {
        padding: 15px 20px;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .metrics-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
}

/* ==========================================
   PROJECT-STRUCTURE MAPPINGS
   ========================================== */

.mapping-card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.mapping-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.mapping-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--border-color);
}

.mapping-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.4em;
}

.mapping-body {
    padding-top: 8px;
}

.project-description {
    color: var(--text-medium);
    margin-bottom: 20px;
    font-size: 0.95em;
}

.structures-section {
    margin-bottom: 20px;
}

.structures-section label {
    display: block;
    margin-bottom: 12px;
    color: var(--text-dark);
    font-size: 1em;
}

.structure-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    padding: 16px;
    background: var(--bg-color);
    border-radius: 6px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: background 0.2s;
}

.checkbox-label:hover {
    background: rgba(30, 60, 114, 0.05);
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-label span {
    font-size: 0.95em;
    color: var(--text-dark);
}

.mapping-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.filters {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.filters select {
    flex: 1;
    max-width: 300px;
}

/* ==========================================
   MODAL STYLES
   ========================================== */

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    padding: 20px;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.25em;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close:hover {
    background-color: var(--bg-color);
    color: var(--danger-color);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.95em;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.95em;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}

/* ==========================================
   TABLE RESPONSIVE STYLES
   ========================================== */

.table-responsive {
    overflow-x: auto;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-icon {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 6px;
    margin: 0 2px;
    border-radius: 4px;
    transition: background 0.2s;
}

.btn-icon:hover {
    background: var(--bg-color);
}

/* ==========================================
   GANTT FULLSCREEN
   ========================================== */

.gantt-fullscreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 9999 !important;
    margin: 0 !important;
    border-radius: 0 !important;
    overflow-y: auto !important;
    max-height: 100vh !important;
    box-shadow: none !important;
}

/* ==========================================
   TOAST NOTIFICATIONS
   ========================================== */

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 420px;
}

.toast {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 18px;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    background: white;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid #ccc;
    font-size: 14px;
}

.toast-visible {
    transform: translateX(0);
    opacity: 1;
}

.toast-success { border-left-color: #27ae60; }
.toast-success .toast-icon { color: #27ae60; }

.toast-error { border-left-color: #e74c3c; }
.toast-error .toast-icon { color: #e74c3c; }

.toast-warning { border-left-color: #f39c12; }
.toast-warning .toast-icon { color: #f39c12; }

.toast-info { border-left-color: #3794C4; }
.toast-info .toast-icon { color: #3794C4; }

.toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.toast-message {
    flex: 1;
    color: #333;
    line-height: 1.5;
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    flex-shrink: 0;
}

.toast-close:hover { color: #333; }

/* ==========================================
   CONFIRM DIALOG
   ========================================== */

.confirm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.confirm-visible { opacity: 1; }

.confirm-dialog {
    background: white;
    border-radius: 14px;
    padding: 32px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    transform: scale(0.9);
    transition: transform 0.2s;
}

.confirm-visible .confirm-dialog { transform: scale(1); }

.confirm-icon { margin-bottom: 16px; }

.confirm-message {
    font-size: 15px;
    color: #333;
    line-height: 1.6;
    margin-bottom: 24px;
    white-space: pre-line;
}

.confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.confirm-btn {
    padding: 10px 28px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-btn-cancel {
    background: #f0f0f0;
    color: #555;
}

.confirm-btn-cancel:hover { background: #e0e0e0; }

.confirm-btn-ok {
    color: white;
}

.confirm-btn-ok:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
}

/* ==========================================
   SENEGAL MAP
   ========================================== */

.map-container {
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

@keyframes pulse-urgent {
    0%   { transform: scale(1);   opacity: 1;   }
    70%  { transform: scale(1.4); opacity: 0;   }
    100% { transform: scale(1.4); opacity: 0;   }
}

@keyframes vuln-pulse {
    0%, 100% { transform: scale(1); box-shadow: 0 1px 3px rgba(0,0,0,0.35), 0 0 0 0 rgba(192,57,43,0.6); }
    50%      { transform: scale(1.15); box-shadow: 0 1px 3px rgba(0,0,0,0.35), 0 0 0 6px rgba(192,57,43,0); }
}

.map-fullscreen .card-header { padding: 12px 16px; }
.map-fullscreen .map-container { border-radius: 0; box-shadow: none; }

/* ==========================================
   CHATBOT WIDGET
   ========================================== */

#chatbot-launcher {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: white;
    color: white;
    border: 2px solid rgba(32,43,93,0.15);
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(32,43,93,0.35);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
    padding: 4px;
}
#chatbot-launcher img { border-radius: 50%; }
#chatbot-launcher:hover {
    transform: scale(1.08);
    box-shadow: 0 10px 26px rgba(32,43,93,0.45);
}
#chatbot-launcher.hidden { display: none; }
#chatbot-launcher::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: linear-gradient(135deg, #202B5D 0%, #3794C4 100%);
    opacity: 0;
    z-index: -1;
    animation: chatbot-pulse 2.2s ease-out 1;
    animation-fill-mode: forwards;
}
@keyframes chatbot-pulse {
    0%   { transform: scale(1);    opacity: 0.3; }
    50%  { transform: scale(1.15); opacity: 0;   }
    100% { transform: scale(1);    opacity: 0;   }
}

#chatbot-panel {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 400px;
    max-width: calc(100vw - 32px);
    height: 620px;
    max-height: calc(100vh - 48px);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    display: none;
    flex-direction: column;
    overflow: hidden;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    transition: opacity 0.2s, transform 0.2s;
}
#chatbot-panel.open {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}
@media (max-width: 480px) {
    #chatbot-panel {
        bottom: 0;
        right: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

#chatbot-header {
    background: linear-gradient(135deg, #202B5D 0%, #3794C4 100%);
    color: white;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
#chatbot-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
#chatbot-avatar img { border-radius: 50%; width: 100%; height: 100%; }
.chatbot-btn-icon {
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.chatbot-btn-icon:hover { background: rgba(255,255,255,0.25); }

#chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f7f9fc;
    scroll-behavior: smooth;
}
#chatbot-messages::-webkit-scrollbar { width: 6px; }
#chatbot-messages::-webkit-scrollbar-thumb { background: #c9d0dd; border-radius: 3px; }

.chat-msg { margin-bottom: 10px; display: flex; }
.chat-msg-user { justify-content: flex-end; }
.chat-msg-user .chat-bubble { max-width: 85%; }
.chat-msg-bot { justify-content: flex-start; }

.chat-bubble {
    max-width: 100%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 13.5px;
    line-height: 1.5;
    word-wrap: break-word;
    animation: chat-msg-in 0.2s ease-out;
}
@keyframes chat-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.chat-bubble-user {
    background: linear-gradient(135deg, #202B5D 0%, #3794C4 100%);
    color: white;
    border-bottom-right-radius: 4px;
}
.chat-bubble-bot {
    background: white;
    color: #2c3e50;
    border: 1px solid #e5e9f0;
    border-bottom-left-radius: 4px;
}
.chat-bubble-bot p { margin: 0 0 8px; }
.chat-bubble-bot p:last-child { margin-bottom: 0; }
.chat-bubble-bot h2 { font-size: 15px; color: #202B5D; margin: 8px 0 6px; }
.chat-bubble-bot h3 { font-size: 14px; color: #202B5D; margin: 8px 0 4px; }
.chat-bubble-bot h4 { font-size: 13px; color: #3794C4; margin: 6px 0 4px; }
.chat-bubble-bot ul, .chat-bubble-bot ol { margin: 4px 0 8px; padding-left: 20px; }
.chat-bubble-bot li { margin-bottom: 3px; }
.chat-bubble-bot code {
    background: #f0f4f8;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 12px;
    color: #202B5D;
}
.chat-bubble-bot pre {
    background: #202B5D;
    color: #e8eef7;
    padding: 10px 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 11.5px;
    margin: 8px 0;
}
.chat-bubble-bot table.chat-table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
    font-size: 12px;
}
.chat-bubble-bot table.chat-table th {
    background: #202B5D;
    color: white;
    padding: 5px 8px;
    text-align: left;
    font-weight: 600;
}
.chat-bubble-bot table.chat-table td {
    padding: 5px 8px;
    border-bottom: 1px solid #eef2f7;
}
.chat-bubble-bot table.chat-table tr:nth-child(even) td { background: #f7f9fc; }
.chat-bubble-bot strong { color: #202B5D; }
.chat-bubble-error {
    background: #fff5f5;
    border-color: #fecdd3;
    color: #b91c1c;
}

.chat-typing {
    display: flex;
    gap: 4px;
    padding: 14px 14px;
}
.chat-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #8896AB;
    animation: chat-typing-dot 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes chat-typing-dot {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

#chatbot-input-wrap {
    display: flex;
    gap: 8px;
    padding: 12px;
    border-top: 1px solid #e5e9f0;
    background: white;
    align-items: flex-end;
    flex-shrink: 0;
}
#chatbot-input {
    flex: 1;
    border: 1px solid #dce3ed;
    border-radius: 20px;
    padding: 10px 14px;
    font-size: 13.5px;
    font-family: inherit;
    resize: none;
    outline: none;
    max-height: 120px;
    min-height: 40px;
    line-height: 1.4;
    transition: border-color 0.15s;
}
#chatbot-input:focus { border-color: #3794C4; }
#chatbot-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #202B5D 0%, #3794C4 100%);
    color: white;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s, opacity 0.15s;
}
#chatbot-send:hover { transform: scale(1.08); }
#chatbot-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chatbot-welcome {
    padding: 10px;
}
.chatbot-suggestion {
    background: white;
    border: 1px solid #dce3ed;
    color: #2c3e50;
    padding: 9px 12px;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    font-size: 13px;
    transition: all 0.15s;
}
.chatbot-suggestion:hover {
    background: #f0f8ff;
    border-color: #3794C4;
    color: #202B5D;
    transform: translateX(2px);
}

/* Badge de notification dans la navbar */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: #e74c3c;
    color: white;
    font-size: 11px;
    font-weight: 700;
    margin-left: auto;
}

.nav-badge-green {
    background: #27ae60;
}

.nav-badge-yellow {
    background: #eab308;
    color: #1f2937;
}

/* Poignée de redimensionnement (coin haut-gauche) */
#chatbot-resize-handle {
    position: absolute;
    top: 0;
    left: 0;
    width: 18px;
    height: 18px;
    cursor: nwse-resize;
    z-index: 10;
    background: linear-gradient(135deg, transparent 50%, rgba(255,255,255,0.5) 50%);
}
#chatbot-resize-handle::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 8px;
    height: 8px;
    border-top: 2px solid rgba(255,255,255,0.9);
    border-left: 2px solid rgba(255,255,255,0.9);
    border-top-left-radius: 3px;
}

/* Mode agrandi */
#chatbot-panel.maximized {
    width: calc(100vw - 48px) !important;
    height: calc(100vh - 48px) !important;
    bottom: 24px;
    right: 24px;
}

/* Wrap bulle + actions */
.chat-bubble-wrap {
    display: flex;
    flex-direction: column;
    max-width: 85%;
}
.chat-actions {
    display: flex;
    gap: 4px;
    margin-top: 4px;
    opacity: 0;
    transition: opacity 0.15s;
}
.chat-msg-bot:hover .chat-actions { opacity: 1; }
.chat-action-btn {
    background: white;
    border: 1px solid #e5e9f0;
    color: #62718D;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}
.chat-action-btn:hover {
    background: #f0f8ff;
    border-color: #3794C4;
    color: #3794C4;
}
.chat-action-btn.chat-action-active {
    background: #202B5D;
    border-color: #202B5D;
    color: white;
    animation: chatbot-pulse-small 1.2s infinite;
}
@keyframes chatbot-pulse-small {
    0%, 100% { box-shadow: 0 0 0 0 rgba(32,43,93,0.45); }
    50% { box-shadow: 0 0 0 4px rgba(32,43,93,0); }
}


/* Dashboard : empile carte + graphique en colonne sur petits écrans */
@media (max-width: 1024px) {
    .view-map-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ==========================================
   MOBILE BURGER MENU
   ========================================== */

#sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@media (max-width: 900px) {
    /* Sidebar masquée par défaut sur mobile, révélée par .sidebar-mobile-open */
    .sidebar.show {
        display: none;
        transform: translateX(-100%);
        transition: transform 0.25s ease;
    }
    .sidebar.show.sidebar-mobile-open {
        display: flex;
        transform: translateX(0);
    }
    .main-content.with-sidebar {
        margin-left: 0;
    }
    #burger-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

/* Étiquettes permanentes (checkbox "Afficher les étiquettes" sur la carte).
   Compact : 1 ligne, 10px, fond blanc translucide, sans flèche noire (on ne veut
   pas de callout visuel fort — c'est un simple label cartographique).
   Cliquable : l'étiquette est un <a href="#/projects/:id"> qui ouvre directement
   le détail du projet, d'où cursor:pointer et effet hover. */
.cngi-label {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid #dce3ed;
    border-radius: 4px;
    padding: 2px 6px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 10px;
    line-height: 1.25;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}
.cngi-label:hover {
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 2px 6px rgba(32, 43, 93, 0.25);
}
.cngi-label::before {
    display: none;                  /* masque la petite flèche Leaflet par défaut */
}
.leaflet-tooltip.cngi-label {
    color: #202B5D;
}
