/* --- LAYOUT GLOBAL --- */
.cv-portal-wrapper, .cv-dashboard-wrapper { max-width: 1200px; margin: 0 auto; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #333; }
.cv-dashboard-wrapper { display: flex; background-color: #f8f9fa; border: 1px solid #e1e4e8; border-radius: 12px; overflow: hidden; min-height: 600px; }

/* --- MESSAGES --- */
.cv-message { padding: 15px; border-radius: 8px; margin-bottom: 20px; font-weight: 500; font-size: 0.95rem; }
.cv-message-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.cv-message-error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* --- SIDEBAR --- */
.cv-sidebar { width: 260px; background-color: #fff; border-right: 1px solid #e1e4e8; display: flex; flex-direction: column; flex-shrink: 0; }
.cv-user-badge { padding: 25px 20px; border-bottom: 1px solid #f0f0f1; display: flex; align-items: center; gap: 15px; }
.cv-avatar img, .cv-avatar span { width: 45px; height: 45px; border-radius: 50%; object-fit: cover; background: #f0f2f5; display: flex; align-items: center; justify-content: center; color: #adb5bd; }
.cv-user-name { font-weight: 700; font-size: 0.95rem; color: #2c3e50; line-height: 1.3; }
.cv-user-name small { color: #0073aa; font-weight: normal; font-size: 0.8rem; }
.cv-nav a { display: flex; align-items: center; gap: 12px; padding: 16px 20px; text-decoration: none; color: #555; font-weight: 500; border-left: 3px solid transparent; transition: all 0.2s; font-size: 0.95rem; }
.cv-nav a:hover { background-color: #f8f9fa; color: #0073aa; }
.cv-nav a.active { background-color: #eaf4fb; color: #0073aa; border-left-color: #0073aa; font-weight: 600; }
.cv-nav a.logout { margin-top: auto; color: #dc3545; border-top: 1px solid #f0f0f1; }
.cv-nav a.logout:hover { background-color: #fff5f5; color: #a71d2a; }

/* --- MAIN CONTENT --- */
.cv-main-content { flex: 1; padding: 40px; overflow-y: auto; background: #fdfdfd; }
.cv-header { margin-bottom: 30px; }
.cv-header h1 { font-size: 1.8rem; margin: 0 0 5px 0; color: #2c3e50; font-weight: 700; }

/* --- LOGIN SPLIT LAYOUT (NOUVEAU) --- */
.cv-login-split-container {
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
    justify-content: center;
    align-items: stretch; /* Hauteur égale */
    margin: 40px 0;
}
.cv-login-card {
    flex: 1;
    min-width: 300px;
    max-width: 450px;
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    border: 1px solid #eef0f2;
}
.cv-login-card.register {
    background-color: #f8fcf8; /* Légère teinte verte pour différencier */
    border-color: #e0efe0;
}
.cv-login-card h2 {
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
    font-size: 1.5rem;
    color: #2c3e50;
}

/* --- GRILLE AGENDA --- */
.cv-events-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 30px; align-items: start; }
.cv-event-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 15px rgba(0,0,0,0.05); border: 1px solid #eef0f2; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s; display: flex; flex-direction: column; }
.cv-event-card:hover { transform: translateY(-3px); box-shadow: 0 12px 20px rgba(0,0,0,0.08); }
.cv-event-header { padding: 20px; border-bottom: 1px solid #f0f0f1; background: #fff; }
.cv-event-date-badge { background-color: #e3f2fd; color: #0073aa; font-size: 0.8rem; padding: 4px 10px; border-radius: 20px; display: inline-block; margin-bottom: 10px; font-weight: 700; letter-spacing: 0.5px; }
.cv-event-title { margin: 0; font-size: 1.3rem; color: #2c3e50; font-weight: 700; line-height: 1.3; }
.cv-event-meta { font-size: 0.9rem; color: #6c757d; margin-top: 8px; display: flex; align-items: center; gap: 5px; }
.cv-event-body { background: #fff; }
.cv-posts-container { border-top: 1px solid #f0f0f1; background: #fafbfc !important; }
.cv-post-row { background: #fff; border: 1px solid #e1e4e8; padding: 15px; margin-bottom: 12px; border-radius: 8px; box-shadow: 0 2px 4px rgba(0,0,0,0.02); }

/* --- DASHBOARD ELEMENTS --- */
.cv-kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 40px; }
.cv-card { background: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #eee; }
.cv-card.kpi { display: flex; align-items: center; gap: 20px; padding: 20px; }
.cv-card .icon { width: 56px; height: 56px; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; }
.cv-card .icon.blue { background: #e3f2fd; color: #1976d2; }
.cv-card .icon.teal { background: #e0f2f1; color: #00897b; }
.cv-card .icon.orange { background: #fff3e0; color: #f57c00; }
.cv-card .number { font-size: 1.6rem; font-weight: 800; color: #2c3e50; line-height: 1; margin-bottom: 4px; display: block; }
.cv-card .label { font-size: 0.85rem; color: #6c757d; font-weight: 500; }
.cv-card .value { font-weight: 700; color: #0073aa; font-size: 1.1rem; }

/* --- BOUTONS --- */
.cv-btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; font-size: 0.9rem; text-decoration: none; display: inline-block; transition: all 0.2s; }
.cv-btn.primary { background: #0073aa; color: white; box-shadow: 0 2px 4px rgba(0,115,170,0.3); }
.cv-btn.primary:hover { background: #005a87; transform: translateY(-1px); }
.cv-btn.secondary { background: #46b450; color: white; }
.cv-btn.full { width: 100%; margin-top: 10px; padding: 12px; }
.cv-btn.disabled { background: #e9ecef; color: #adb5bd; cursor: not-allowed; box-shadow: none; }
.cv-btn-delete { background: transparent; border: 1px solid #ffcdd2; color: #e53935; padding: 6px 12px; font-size: 0.8rem; border-radius: 4px; margin-left: auto; }
.cv-btn-delete:hover { background: #ffebee; border-color: #e53935; }

/* --- FORMS --- */
.cv-form-row { display: flex; gap: 20px; margin-bottom: 18px; }
.cv-form-row .col { flex: 1; }
.cv-form-row label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; color: #495057; }
.cv-form-row input[type="text"], .cv-login-card input { width: 100%; padding: 10px 12px; border: 1px solid #ced4da; border-radius: 6px; font-size: 0.95rem; box-sizing: border-box; }
.cv-form-row input[type="text"]:focus, .cv-login-card input:focus { border-color: #0073aa; outline: none; box-shadow: 0 0 0 3px rgba(0,115,170,0.1); }

/* Responsive */
@media (max-width: 768px) {
    .cv-dashboard-wrapper { flex-direction: column; }
    .cv-sidebar { width: 100%; border-right: none; border-bottom: 1px solid #e1e4e8; }
    .cv-nav { flex-direction: row; overflow-x: auto; padding-bottom: 5px; }
    .cv-login-split-container { flex-direction: column; align-items: center; }
    .cv-login-card { width: 100%; }
}