/* =========================================================
   CAMPUS UNIVERSITAIRE — Feuille de style centrale
   Couleur dominante : BLEU. Signature : Propulsé par PEFEP TECH
   ========================================================= */

:root {
    --bleu:        #005AA9;   /* bleu principal */
    --bleu-fonce:  #002D62;   /* titres, en-têtes */
    --bleu-clair:  #eef4fb;   /* fonds doux */
    --vert:        #00A651;   /* actions positives, succès */
    --vert-clair:  #e9f7ef;
    --orange:      #e69500;   /* alertes douces, en attente */
    --rouge:       #b00020;   /* erreurs, suppression */
    --gris-fond:   #f5f7fa;   /* fond de page */
    --gris-bord:   #e3e8ef;   /* bordures */
    --gris-texte:  #556;      /* texte secondaire */
    --texte:       #1f2933;   /* texte principal */
    --radius:      10px;
    --ombre:       0 1px 3px rgba(0,0,0,0.07);
    --ombre-forte: 0 4px 16px rgba(0,0,0,0.10);
}

* { box-sizing: border-box; }

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    margin: 0;
    background: var(--gris-fond);
    color: var(--texte);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4 {
    font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
    color: var(--bleu-fonce);
    line-height: 1.25;
}

a { color: var(--bleu); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Conteneur principal ---------- */
.cu-wrap { max-width: 1000px; margin: 0 auto; padding: 0 20px 48px; width: 100%; }
.cu-wrap--narrow { max-width: 640px; }
.cu-main { flex: 1; }

/* ---------- Barre de navigation ---------- */
.cu-nav {
    background: var(--bleu-fonce);
    padding: 0 20px;
}
.cu-nav__inner {
    max-width: 1000px; margin: 0 auto;
    display: flex; align-items: center; gap: 18px;
    flex-wrap: wrap; min-height: 60px;
}
.cu-nav__brand { color: #fff; font-weight: 700; font-family: 'Poppins', sans-serif; margin-right: auto; font-size: 18px; }
.cu-nav a { color: #cfe0f5; font-size: 14px; }
.cu-nav a:hover { color: #fff; text-decoration: none; }
.cu-nav__logout button {
    background: var(--vert); color: #fff; border: none;
    padding: 7px 14px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
.cu-nav__logout button:hover { background: #00913f; }

/* ---------- Titres de page ---------- */
.cu-title { margin: 28px 0 4px; }
.cu-subtitle { color: var(--gris-texte); margin: 0 0 20px; }

/* ---------- Cartes ---------- */
.cu-card {
    background: #fff; border-radius: var(--radius);
    padding: 20px; box-shadow: var(--ombre); margin-bottom: 16px;
}
.cu-grid {
    display: grid; gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* ---------- Boutons ---------- */
.cu-btn {
    display: inline-block; padding: 10px 18px; border-radius: 8px;
    border: none; cursor: pointer; font-size: 14px; font-family: 'Poppins', sans-serif;
    text-decoration: none; font-weight: 500;
}
.cu-btn:hover { text-decoration: none; opacity: 0.92; }
.cu-btn--primary { background: var(--vert); color: #fff; }
.cu-btn--blue    { background: var(--bleu); color: #fff; }
.cu-btn--light   { background: var(--bleu-clair); color: var(--bleu); }
.cu-btn--danger  { background: none; color: var(--rouge); padding: 6px 0; }

/* ---------- Tableaux ---------- */
.cu-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--ombre); }
.cu-table thead tr { background: var(--bleu-fonce); color: #fff; text-align: left; }
.cu-table th, .cu-table td { padding: 11px 12px; }
.cu-table tbody tr { border-bottom: 1px solid var(--gris-bord); }
.cu-table tbody tr:last-child { border-bottom: none; }

/* ---------- Formulaires ---------- */
.cu-field { margin-bottom: 14px; }
.cu-field label { display: block; font-size: 13px; color: var(--gris-texte); margin-bottom: 4px; }
.cu-input, input[type="text"].cu-input, input[type="email"], input[type="password"],
input[type="number"], input[type="date"], select, textarea {
    width: 100%; padding: 9px 11px; border: 1px solid var(--gris-bord);
    border-radius: 8px; font-size: 14px; font-family: inherit; background: #fff;
}
.cu-input:focus, input:focus, select:focus, textarea:focus {
    outline: none; border-color: var(--bleu); box-shadow: 0 0 0 3px rgba(0,90,169,0.12);
}

/* ---------- Messages (alertes) ---------- */
.cu-alert { padding: 12px 14px; border-radius: 8px; margin: 16px 0; }
.cu-alert--success { background: var(--vert-clair); color: #00733b; border: 1px solid var(--vert); }
.cu-alert--error   { background: #fdecea; color: var(--rouge); border: 1px solid var(--rouge); }
.cu-alert--warning { background: #fff8e1; color: #b06f00; border: 1px solid var(--orange); }

/* ---------- Badges de statut ---------- */
.cu-badge { padding: 3px 10px; border-radius: 12px; font-size: 12px; color: #fff; display: inline-block; }
.cu-badge--green  { background: var(--vert); }
.cu-badge--orange { background: var(--orange); }
.cu-badge--red    { background: var(--rouge); }
.cu-badge--grey   { background: #777; }

/* ---------- Pied de page ---------- */
.cu-footer {
    text-align: center; padding: 20px; color: #8a97a6; font-size: 13px;
    border-top: 1px solid var(--gris-bord); background: #fff;
}
.cu-footer strong { color: var(--bleu); }

/* ---------- Carte de connexion (login) ---------- */
.cu-auth {
    max-width: 420px; margin: 60px auto; background: #fff;
    border-radius: 14px; box-shadow: var(--ombre-forte); padding: 36px 32px;
}
.cu-auth__brand { text-align: center; margin-bottom: 8px; color: var(--bleu-fonce); font-family: 'Poppins', sans-serif; }

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .cu-nav__inner { gap: 12px; }
    .cu-nav__brand { font-size: 16px; }
}

/* =========================================================
   MISE EN PAGE AVEC BARRE LATÉRALE (layout application)
   ========================================================= */

.cu-shell { display: flex; min-height: 100vh; flex: 1; }

/* ---- Barre latérale ---- */
.cu-side {
    width: 240px; background: var(--bleu-fonce); color: #fff;
    display: flex; flex-direction: column; flex-shrink: 0;
}
.cu-side__brand {
    padding: 20px 18px; font-family: 'Poppins', sans-serif; font-weight: 700;
    font-size: 17px; color: #fff; border-bottom: 1px solid rgba(255,255,255,0.12);
    line-height: 1.3;
}
.cu-side__nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.cu-side__nav a {
    display: block; color: #cfe0f5; padding: 10px 18px; font-size: 14px;
    border-left: 3px solid transparent;
}
.cu-side__nav a:hover { background: rgba(255,255,255,0.07); color: #fff; text-decoration: none; border-left-color: var(--vert); }
.cu-side__foot { padding: 14px 18px; border-top: 1px solid rgba(255,255,255,0.12); }
.cu-side__foot button {
    width: 100%; background: var(--vert); color: #fff; border: none;
    padding: 9px; border-radius: 6px; cursor: pointer; font-size: 13px; font-family: 'Poppins', sans-serif;
}
.cu-side__foot button:hover { background: #00913f; }

/* ---- Zone de contenu à droite ---- */
.cu-content { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.cu-content__body { flex: 1; padding: 8px 32px 32px; }
.cu-content__body .cu-wrap { max-width: 920px; margin: 0; padding: 0; }

/* ---- Barre supérieure (mobile : bouton menu) ---- */
.cu-topbar {
    display: none; align-items: center; gap: 12px;
    background: var(--bleu-fonce); color: #fff; padding: 12px 16px;
}
.cu-topbar__burger { background: none; border: none; color: #fff; font-size: 22px; cursor: pointer; }
.cu-topbar__title { font-family: 'Poppins', sans-serif; font-weight: 600; }

/* ---- Responsive : sidebar repliable ---- */
@media (max-width: 820px) {
    .cu-shell { flex-direction: column; }
    .cu-topbar { display: flex; }
    .cu-side {
        width: 100%; display: none;
    }
    .cu-side.cu-side--open { display: flex; }
    .cu-side__nav a { padding: 12px 18px; }
}