:root {
  --primary: #0D4C4A;
  --primary-light: #1a6b68;
  --accent: #D97706;
  --accent-light: #FEF3C7;
  --success: #16A34A;
  --danger: #DC2626;
  --warning: #D97706;
  --bg: #F4F6F8;
  --card-bg: #FFFFFF;
  --border: #E2E8F0;
  --text: #0F172A;
  --muted: #64748B;
  --sidebar-w: 240px;
}

* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); margin: 0; }

/* ── Sidebar ─────────────────────────────────── */
.sidebar {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w); background: var(--primary);
  display: flex; flex-direction: column; z-index: 1000;
  transition: transform .25s;
}
.sidebar-brand {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 16px 20px; border-bottom: 1px solid rgba(255,255,255,.15);
}
.sidebar-brand i { font-size: 2rem; color: #fff; margin-bottom: 6px; }
.sidebar-brand span { color: #fff; font-size: 1.1rem; font-weight: 800; letter-spacing: 3px; }
.sidebar-brand small { color: rgba(255,255,255,.6); font-size: .75rem; letter-spacing: 2px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 20px; color: rgba(255,255,255,.75);
  text-decoration: none; font-size: .9rem; font-weight: 500;
  transition: background .15s, color .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.12); color: #fff;
}
.sidebar-nav a i { font-size: 1rem; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px; border-top: 1px solid rgba(255,255,255,.15); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.sidebar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .85rem; font-weight: 700; flex-shrink: 0;
}
.sidebar-username { color: #fff; font-size: .85rem; font-weight: 600; }
.sidebar-role { color: rgba(255,255,255,.55); font-size: .75rem; }

/* ── Main ────────────────────────────────────── */
.main-content { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  background: var(--card-bg); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 100;
}
.topbar-title { font-size: 1.15rem; font-weight: 700; margin: 0; flex: 1; }
.topbar-date { font-size: .8rem; color: var(--muted); }
.page-body { padding: 24px; flex: 1; }

/* ── Cards ───────────────────────────────────── */
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.05); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); font-weight: 600; }

/* ── Stat cards ──────────────────────────────── */
.stat-card {
  background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 20px; display: flex; flex-direction: column;
}
.stat-value { font-size: 2.2rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: .8rem; color: var(--muted); margin-top: 6px; font-weight: 500; text-transform: uppercase; letter-spacing: .5px; }

/* ── Status badges ───────────────────────────── */
.status-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600;
}
.badge-programme    { background: #DBEAFE; color: #1D4ED8; }
.badge-en-cours     { background: #FEF3C7; color: #B45309; }
.badge-termine      { background: #DCFCE7; color: #15803D; }
.badge-annule       { background: #FEE2E2; color: #B91C1C; }
.badge-disponible   { background: #DCFCE7; color: #15803D; }
.badge-secondary    { background: #F1F5F9; color: #475569; }

/* ── Tables ──────────────────────────────────── */
.table { font-size: .875rem; }
.table th { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); border-bottom: 2px solid var(--border); }
.table td { vertical-align: middle; }
.table-hover tbody tr:hover { background: #F8FAFC; cursor: pointer; }

/* ── Forms ───────────────────────────────────── */
.form-control, .form-select {
  border: 1px solid var(--border); border-radius: 8px; font-size: .875rem;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(13,76,74,.12);
}

/* ── Buttons ─────────────────────────────────── */
.btn-primary { background: var(--primary); border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #B45309; border-color: #B45309; color: #fff; }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }

/* ── Alert cards ─────────────────────────────── */
.alert-card {
  background: #FFF7ED; border: 1px solid #FED7AA; border-radius: 10px;
  padding: 12px 16px; display: flex; align-items: flex-start; gap: 10px;
}
.alert-card.critical { background: #FEF2F2; border-color: #FECACA; }
.alert-card i { margin-top: 2px; }

/* ── Mobile ──────────────────────────────────── */
@media (max-width: 768px) {
  .main-content { margin-left: 0; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-toggle { display: inline-flex !important; }
  .page-body { padding: 16px; }
}
.sidebar-toggle { background: transparent; border: none; font-size: 1.4rem; }

/* ── Misc ────────────────────────────────────── */
.text-primary-custom { color: var(--primary) !important; }
.text-accent { color: var(--accent) !important; }
.section-title { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-bottom: 12px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.progress-thin { height: 6px; border-radius: 3px; }
