/* Variables CSS */
:root {
    --tontine-primary: #2656FF;
    --tontine-secondary: #4A6BDF;
    --tontine-accent: #FF5722;
    --tontine-success: #4CAF50;
    --tontine-warning: #FF9800;
    --tontine-error: #F44336;
    --tontine-light: #FFFFFF;
    --tontine-dark: #333333; /* Modifié pour un noir moins dur */
    --tontine-border: #E0E0E0;
    --tontine-bg-light: #F8F9FA;
    --tontine-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --tontine-radius: 16px;
}

/* Reset et base */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--tontine-dark);
    line-height: 1.6;
}

/* Conteneur principal */
.tontine-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 30px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: var(--tontine-radius);
    box-shadow: var(--tontine-shadow);
    position: relative;
    overflow: hidden;
}
.tontine-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--tontine-primary), var(--tontine-secondary));
}

/* Titres */
h1, h2, h3, h4, h5, h6 { color: var(--tontine-dark); margin-bottom: 20px; font-weight: 600; position: relative; }
h1 { font-size: 2.5rem; margin-bottom: 30px; padding-bottom: 15px; }
h1::after { content: ''; position: absolute; bottom: 0; left: 0; width: 80px; height: 4px; background: linear-gradient(90deg, var(--tontine-primary), var(--tontine-secondary)); border-radius: 2px; }
h2 { font-size: 1.8rem; margin-top: 40px; padding-bottom: 10px; border-bottom: 2px solid var(--tontine-border); }

/* Dashboard amélioré (Structure) */
.dashboard-container { display: grid; grid-template-columns: 260px 1fr; gap: 30px; align-items: start; }
.dashboard-sidebar { background: white; border-radius: var(--tontine-radius); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); position: sticky; top: 30px; }
.sidebar-header { padding: 20px; border-bottom: 1px solid var(--tontine-border); }
.sidebar-header h3 { margin: 0; color: var(--tontine-primary); font-size: 1.2rem; display: flex; align-items: center; }
.sidebar-header .dashicons { margin-right: 8px; }
.sidebar-nav ul { list-style: none; padding: 10px 0; margin: 0; }
.sidebar-nav .nav-link { display: flex; align-items: center; padding: 15px 20px; text-decoration: none; color: #555; font-weight: 500; transition: all 0.3s ease; border-left: 4px solid transparent; }
.sidebar-nav .nav-link:hover { background: rgba(38, 86, 255, 0.05); color: var(--tontine-primary); border-left-color: var(--tontine-primary); }
.sidebar-nav .nav-link.active { background: rgba(38, 86, 255, 0.1); color: var(--tontine-primary); font-weight: 600; border-left-color: var(--tontine-primary); }
.sidebar-nav .nav-link .dashicons { margin-right: 15px; font-size: 1.2rem; width: 20px; text-align: center; }

/* Cartes de statistiques */
.tontine-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 25px; margin-bottom: 40px; }
.stat-card { background: white; padding: 30px; border-radius: var(--tontine-radius); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); position: relative; overflow: hidden; transition: all 0.3s ease; border: 1px solid rgba(38, 86, 255, 0.1); }
.stat-card:hover { transform: translateY(-8px); box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15); }
.stat-number { font-size: 3rem; font-weight: 700; color: var(--tontine-primary); margin-bottom: 10px; }
.stat-label { color: #6c757d; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; }

/* Section des graphiques */
.charts-section { margin: 40px 0; }
.chart-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 30px; margin-bottom: 30px; }
.chart-container { background: white; padding: 30px; border-radius: var(--tontine-radius); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); }
.chart-title { font-size: 1.4rem; font-weight: 600; margin-bottom: 20px; }
.chart-wrapper { position: relative; height: 300px; width: 100%; }

/* Grille des tontines */
.tontine-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 30px; margin-top: 30px; }
.tontine-card { background: white; border-radius: var(--tontine-radius); padding: 30px; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275); border: 1px solid rgba(38, 86, 255, 0.1); position: relative; overflow: hidden; }
.tontine-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 40px rgba(38, 86, 255, 0.2); }
.tontine-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.tontine-title { font-size: 1.5rem; font-weight: 700; color: var(--tontine-dark); margin: 0; }
.tontine-status { padding: 6px 16px; border-radius: 30px; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); }
.status-draft { background: linear-gradient(135deg, #e0e0e0, #f5f5f5); color: #616161; }
.status-active { background: linear-gradient(135deg, #E8F5E8, #C8E6C9); color: var(--tontine-success); }
.status-completed { background: linear-gradient(135deg, #E3F2FD, #BBDEFB); color: #1976D2; }
.status-cancelled { background: linear-gradient(135deg, #f8d7da, #f1aeb5); color: #721c24; }
.tontine-info { margin: 25px 0; }
.info-row { display: flex; justify-content: space-between; margin: 12px 0; font-size: 1rem; padding: 8px 0; border-bottom: 1px dashed rgba(0, 0, 0, 0.05); }
.info-row:last-child { border-bottom: none; }
.info-label { color: #6c757d; font-weight: 500; }
.info-value { color: var(--tontine-dark); font-weight: 600; }
.amount { color: var(--tontine-primary); font-weight: 700; font-size: 1.1rem; }

/* Barre de progression */
.progress-bar { width: 100%; height: 12px; background: #f0f0f0; border-radius: 10px; overflow: hidden; margin: 20px 0; position: relative; box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.1); }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--tontine-primary), var(--tontine-secondary)); border-radius: 10px; transition: width 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275); }

/* Boutons */
.tontine-btn { padding: 14px 28px; border: none; border-radius: 30px; font-weight: 600; text-decoration: none; display: inline-block; text-align: center; cursor: pointer; transition: all 0.3s ease; font-size: 0.95rem; }
.btn-primary { background: linear-gradient(135deg, var(--tontine-primary), var(--tontine-secondary)); color: white; box-shadow: 0 4px 15px rgba(38, 86, 255, 0.3); }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(38, 86, 255, 0.4); }
.btn-secondary { background: white; color: var(--tontine-dark); border: 2px solid var(--tontine-border); }
.btn-secondary:hover { background: var(--tontine-bg-light); border-color: var(--tontine-primary); color: var(--tontine-primary); }

/* Formulaires */
.tontine-form { background: white; padding: 40px; border-radius: var(--tontine-radius); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); margin: 30px 0; }
.form-group { margin-bottom: 25px; }
.form-label { display: block; margin-bottom: 10px; font-weight: 600; }
.form-input, .form-select, .form-textarea { width: 100%; padding: 15px 20px; border: 2px solid var(--tontine-border); border-radius: 10px; font-size: 1rem; transition: all 0.3s ease; }
.form-input:focus, .form-select:focus, .form-textarea:focus { outline: none; border-color: var(--tontine-primary); box-shadow: 0 0 0 4px rgba(38, 86, 255, 0.1); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 25px; }
.tontine-form .form-select, .tontine-form select { color: var(--tontine-dark) !important; }
.tontine-form .form-select option, .tontine-form select option { color: #000000; }

/* Tableaux */
.members-table { width: 100%; border-collapse: collapse; margin: 30px 0; background: white; border-radius: var(--tontine-radius); overflow: hidden; box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08); }
.members-table th, .members-table td { padding: 18px 20px; text-align: left; border-bottom: 1px solid var(--tontine-border); }
.members-table th { background: linear-gradient(135deg, #f8f9fa, #e9ecef); font-weight: 700; text-transform: uppercase; font-size: 0.85rem; }
.members-table tbody tr:last-child td { border-bottom: none; }
.members-table tbody tr:hover { background-color: rgba(38, 86, 255, 0.03); }
.payment-status { padding: 6px 14px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.payment-pending { background: linear-gradient(135deg, #FFF3E0, #FFE0B2); color: #E65100; }
.payment-completed { background: linear-gradient(135deg, #E8F5E8, #C8E6C9); color: #1B5E20; }

/* Messages */
.tontine-message { margin-top: 25px; padding: 18px 25px; border-radius: 10px; display: none; font-weight: 500; }
.tontine-message.success { background: linear-gradient(135deg, #E8F5E8, #C8E6C9); color: #1B5E20; border-left: 5px solid var(--tontine-success); display: block; }
.tontine-message.error { background: linear-gradient(135deg, #FFEBEE, #FFCDD2); color: #B71C1C; border-left: 5px solid var(--tontine-error); display: block; }

/* Animations et effets */
.tontine-grid.enhanced .tontine-card { opacity: 0; transform: translateY(30px); animation: cardFadeInUp 0.6s ease-out forwards; }
@keyframes cardFadeInUp { to { opacity: 1; transform: translateY(0); } }
.tontine-card.enhanced:hover { transform: translateY(-10px) scale(1.02); box-shadow: 0 20px 40px rgba(38, 86, 255, 0.2); border-left-color: var(--tontine-primary); }
.empty-state { text-align: center; padding: 50px 20px; background: #f8f9fa; border-radius: var(--tontine-radius); margin: 40px 0; border: 2px dashed var(--tontine-border); }
.empty-icon { font-size: 4rem; margin-bottom: 20px; display: inline-block; animation: bounceIcon 2s infinite ease-in-out; }
@keyframes bounceIcon { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-20px); } }
.tontine-tabs { display: flex; border-bottom: 2px solid var(--tontine-border); margin-bottom: 30px; }
.tab-btn { padding: 12px 24px; background: none; border: none; font-size: 1rem; font-weight: 600; color: #6c757d; cursor: pointer; position: relative; }
.tab-btn.active { color: var(--tontine-primary); }
.tab-btn.active::after { content: ''; position: absolute; bottom: -2px; left: 0; right: 0; height: 3px; background: var(--tontine-primary); }
.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* STYLES POUR LA PAGE PUBLIQUE (SHOWCASE) */
.showcase-section { margin-bottom: 60px; padding: 30px; background: var(--tontine-light); border-radius: var(--tontine-radius); box-shadow: 0 5px 20px rgba(0,0,0,0.05); }
.showcase-title { font-size: 1.8rem; color: var(--tontine-primary); margin-bottom: 5px; }
.showcase-subtitle { font-size: 1.1rem; color: #6c757d; margin-bottom: 30px; }
.tontine-list { list-style: none; padding-left: 0; }
.tontine-list li { padding: 15px; border-bottom: 1px solid var(--tontine-border); font-size: 1.1rem; }
.tontine-list li:last-child { border-bottom: none; }
.tontine-list.success li::before { content: '✅'; margin-right: 10px; }

/* Responsive */
@media (max-width: 992px) { .dashboard-container { grid-template-columns: 1fr; } .dashboard-sidebar { position: static; margin-bottom: 30px; } }
@media (max-width: 768px) { .form-row, .chart-row { grid-template-columns: 1fr; } }