:root {
    --sidebar-bg: #0f172a;
    --primary: #3b82f6;
    --primary-light: rgba(59, 130, 246, 0.1);
    --danger: #f43f5e;
    --warning: #f59e0b;
    --bg-main: #f8fafc;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, sans-serif; background: var(--bg-main); display: flex; height: 100vh; overflow: hidden; }

/* Sidebar Originale */
#sidebar { width: 280px; background: var(--sidebar-bg); display: flex; flex-direction: column; transition: 0.3s; z-index: 1000; }
.sidebar-header { padding: 30px 25px; display: flex; align-items: center; gap: 15px; }
.logo-icon { background: linear-gradient(135deg, var(--primary), #8b5cf6); width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; }
.logo-text { font-size: 1.3rem; font-weight: 800; color: white; }
.sidebar-menu { flex-grow: 1; overflow-y: auto; padding: 10px 15px; }
.menu-label { font-size: 0.65rem; text-transform: uppercase; color: #475569; font-weight: 800; margin: 25px 0 10px 15px; }
.sidebar-item { display: flex; align-items: center; gap: 12px; padding: 12px 15px; color: #94a3b8; text-decoration: none; font-size: 0.9rem; border-radius: var(--radius); }
.sidebar-item.active { background: var(--primary); color: white; }

/* Main Content & Header */
.main-content { flex-grow: 1; display: flex; flex-direction: column; overflow: hidden; }
header { height: 80px; background: white; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 40px; }
.content-body { padding: 40px; overflow-y: auto; }

/* Grid & Cards */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; margin-bottom: 40px; }
.stat-card { background: white; padding: 25px; border-radius: var(--radius); border: 1px solid var(--border); }
.stat-header { display: flex; justify-content: space-between; }
.stat-value { font-size: 1.8rem; font-weight: 800; }
.mini-graph { display: flex; align-items: flex-end; gap: 4px; height: 40px; margin-top: 15px; }
.bar { flex: 1; background: var(--primary-light); border-radius: 2px; }

/* Tables */
.table-container { background: white; border-radius: var(--radius); border: 1px solid var(--border); overflow: hidden; }
.table-header { padding: 25px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); }
table { width: 100%; border-collapse: collapse; }
th { background: #f8fafc; padding: 15px 25px; text-align: left; font-size: 0.7rem; text-transform: uppercase; color: var(--text-muted); }
td { padding: 20px 25px; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.status-paid { background: #dcfce7; color: #10b981; padding: 5px 12px; border-radius: 20px; font-weight: 700; font-size: 0.75rem; }
.btn-main { background: var(--primary); color: white; border: none; padding: 10px 20px; border-radius: 8px; font-weight: 700; cursor: pointer; }

/* --- NOUVELLES REGLES RESPONSIVE --- */

@media (max-width: 1024px) {
    #sidebar { position: fixed; left: -280px; height: 100vh; }
    #sidebar.open { left: 0; }
    #mobile-burger { display: block !important; }
    .search-bar { display: none; }
}

@media (max-width: 768px) {
    .content-body { padding: 20px; }
    .stats-grid { grid-template-columns: 1fr; }
    .hide-mobile { display: none; }
    
    /* Table Responsive */
    thead { display: none; }
    tbody tr { display: block; border-bottom: 2px solid var(--border); margin-bottom: 10px; }
    tbody td { display: flex; justify-content: space-between; padding: 10px 15px; border: none; }
    tbody td::before { content: attr(data-label); font-weight: 800; color: var(--text-muted); font-size: 0.7rem; text-transform: uppercase; }
}
