/**
 * Styles principaux - Espace Propreté
 * Design type SaaS, responsive
 */

:root {
    --sidebar-width: 240px;
    --topbar-height: 56px;
    --color-primary: #2563eb;
    --color-primary-dark: #1d4ed8;
    --color-success: #22c55e;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-muted: #64748b;
    --bg-sidebar: #1e293b;
    --bg-main: #f8fafc;
    --border: #e2e8f0;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08);
}

* { box-sizing: border-box; }
body { margin: 0; font-family: 'Segoe UI', system-ui, sans-serif; font-size: 14px; line-height: 1.5; color: #334155; background: var(--bg-main); }

/* ---------- Login ---------- */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e293b 0%, #334155 100%); }
.login-container { width: 100%; max-width: 400px; padding: 20px; }
.login-card { background: #fff; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0,0,0,.15); padding: 32px; }
.login-header { text-align: center; margin-bottom: 24px; }
.login-header h1 { margin: 0; font-size: 22px; color: #1e293b; }
.login-header p { margin: 8px 0 0; color: var(--color-muted); }
.login-form .form-group { margin-bottom: 16px; }
.login-form label { display: block; margin-bottom: 6px; font-weight: 500; }
.login-form input { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.login-footer { text-align: center; margin-top: 20px; color: rgba(255,255,255,.7); font-size: 12px; }

/* ---------- Layout Admin / Client ---------- */
.admin-layout, .client-layout { display: flex; min-height: 100vh; }
.sidebar { width: var(--sidebar-width); background: var(--bg-sidebar); color: #e2e8f0; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar-brand { padding: 20px; font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.sidebar-brand .logo { color: #fff; }
.sidebar-brand .badge { font-size: 11px; background: var(--color-primary); color: #fff; padding: 2px 8px; border-radius: 4px; }
.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #94a3b8; text-decoration: none; transition: background .15s, color .15s; }
.sidebar-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.sidebar-nav a.active { background: var(--color-primary); color: #fff; }
.sidebar-nav .icon { font-size: 16px; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer .logout { color: #94a3b8; text-decoration: none; font-size: 13px; }
.sidebar-footer .logout:hover { color: #fff; }

.main-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.topbar { height: var(--topbar-height); padding: 0 24px; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
.page-title { margin: 0; font-size: 18px; font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 12px; }
.user-name { font-size: 13px; color: var(--color-muted); }
.notif-badge { background: var(--color-danger); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 10px; }
.content-inner { flex: 1; padding: 24px; }

/* ---------- Cards & Tables ---------- */
.card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.card-header { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.card-header h2, .card h2 { margin: 0 0 16px; font-size: 16px; }
.card h3 { margin: 16px 0 8px; font-size: 14px; }
.table-responsive { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { font-weight: 600; color: #475569; background: #f8fafc; }
.table tbody tr:hover { background: #f8fafc; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.badge-success { background: #dcfce7; color: #166534; }
.badge-secondary { background: #f1f5f9; color: #475569; }
.badge-planifie { background: #dbeafe; color: #1e40af; }
.badge-realise { background: #dcfce7; color: #166534; }
.badge-reporte { background: #fef3c7; color: #b45309; }
.badge-annule { background: #fee2e2; color: #b91c1c; }
.badge-absent { background: #f1f5f9; color: #475569; }
.badge-nouvelle, .badge-en_cours { background: #dbeafe; color: #1e40af; }
.badge-acceptee { background: #dcfce7; color: #166534; }
.badge-refusee { background: #fee2e2; color: #b91c1c; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 8px 16px; font-size: 14px; font-weight: 500; border-radius: 6px; border: none; cursor: pointer; text-decoration: none; transition: background .15s, color .15s; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); }
.btn-outline { background: transparent; color: var(--color-primary); border: 1px solid var(--color-primary); }
.btn-outline:hover { background: #eff6ff; }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: 13px; }

/* ---------- Forms ---------- */
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; }
.form-group { margin-bottom: 16px; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 6px; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
.form-group textarea { min-height: 80px; resize: vertical; }
.form-actions { margin-top: 20px; display: flex; gap: 12px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.form-inline { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.form-inline input, .form-inline select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-select { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-danger { background: #fee2e2; color: #b91c1c; }

/* ---------- Dashboard ---------- */
.dashboard-grid { display: grid; gap: 20px; }
.stat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.stat-card { background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); text-align: center; }
.stat-card.warning { border-left: 4px solid var(--color-warning); }
.stat-value { font-size: 24px; font-weight: 700; color: var(--color-primary); }
.stat-label { font-size: 12px; color: var(--color-muted); margin-top: 4px; }
.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 900px) { .dashboard-row { grid-template-columns: 1fr; } }
.notif-list { list-style: none; padding: 0; margin: 0; }
.notif-list li { padding: 10px 0; border-bottom: 1px solid var(--border); }
.notif-list li.unread { font-weight: 500; }
.notif-list small { display: block; color: var(--color-muted); font-size: 12px; margin-top: 2px; }

/* ---------- Calendar ---------- */
#calendar { max-width: 100%; }
.fc { font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 6px; }
.dot { width: 12px; height: 12px; border-radius: 50%; }

/* ---------- Utils ---------- */
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.pagination { display: flex; gap: 8px; margin-top: 16px; }
.pagination .btn.active { background: var(--color-primary); color: #fff; }
.hidden { display: none !important; }
.list-unstyled { list-style: none; padding: 0; margin: 0; }

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .sidebar { width: 60px; }
    .sidebar-brand .logo, .sidebar-nav a span:not(.icon) { display: none; }
    .sidebar-nav a { justify-content: center; padding: 12px; }
    .content-inner { padding: 16px; }
    .form-grid { grid-template-columns: 1fr; }
}
