/* =====================================================================
   HAMIDOUSIF School Manager – thème
   Couleurs issues de la charte HAMIDOUSIF : bleu marine, orange, gris.
   ===================================================================== */
:root {
    --navy: #213d77;
    --navy-900: #14264d;
    --navy-800: #182e5c;
    --navy-100: #e6ebf5;
    --navy-50: #f2f5fb;
    --orange: #ea5b2c;          /* décor, icônes, pastilles */
    --orange-700: #c2410c;      /* texte / boutons sur fond blanc (contraste AA) */
    --orange-100: #fdeae2;
    --grey: #636767;
    --ink: #172033;
    --muted: #5b6478;
    --line: #e4e8f1;
    --surface: #f5f7fb;
    --radius: 14px;
    --shadow-sm: 0 1px 2px rgba(20, 38, 77, .06);
    --shadow: 0 4px 16px rgba(20, 38, 77, .07);

    --bs-body-font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --bs-body-color: var(--ink);
    --bs-primary: #213d77;
    --bs-primary-rgb: 33, 61, 119;
    --bs-link-color: #213d77;
    --bs-link-color-rgb: 33, 61, 119;
    --bs-link-hover-color: #c2410c;
    --bs-border-color: var(--line);
    --bs-border-radius: 10px;
}

body { background: var(--surface); font-size: .925rem; color: var(--ink); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5, .h1, .h2, .h3, .h4, .h5, .page-head h1, .topbar-title, .brand-text strong {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif; letter-spacing: -.01em;
}
::selection { background: var(--orange-100); }

/* ---------- Boutons & composants Bootstrap aux couleurs de la marque ---------- */
.btn { background-image: none; border-radius: 10px; font-weight: 500; padding: .5rem 1rem; }
.btn-sm { border-radius: 8px; padding: .3rem .65rem; }
.btn-primary {
    --bs-btn-bg: var(--navy); --bs-btn-border-color: var(--navy);
    --bs-btn-hover-bg: var(--navy-800); --bs-btn-hover-border-color: var(--navy-800);
    --bs-btn-active-bg: var(--navy-900); --bs-btn-active-border-color: var(--navy-900);
    --bs-btn-disabled-bg: var(--navy); --bs-btn-disabled-border-color: var(--navy);
    box-shadow: 0 2px 6px rgba(33, 61, 119, .25);
}
.btn-outline-primary {
    --bs-btn-color: var(--navy); --bs-btn-border-color: #b8c4de;
    --bs-btn-hover-bg: var(--navy); --bs-btn-hover-border-color: var(--navy); --bs-btn-hover-color: #fff;
    --bs-btn-active-bg: var(--navy-800); --bs-btn-active-border-color: var(--navy-800);
}
.btn-accent {
    --bs-btn-color: #fff; --bs-btn-bg: var(--orange-700); --bs-btn-border-color: var(--orange-700);
    --bs-btn-hover-color: #fff; --bs-btn-hover-bg: #a8380a; --bs-btn-hover-border-color: #a8380a;
    --bs-btn-active-bg: #8f2f08; --bs-btn-active-border-color: #8f2f08; --bs-btn-active-color: #fff;
    box-shadow: 0 2px 8px rgba(194, 65, 12, .3);
}
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-hover-bg: var(--navy-50); --bs-btn-hover-border-color: #cfd7e8; }
.text-primary { color: var(--navy) !important; }
.bg-primary, .text-bg-primary { background-color: var(--navy) !important; }
.text-accent { color: var(--orange-700) !important; }
.nav-pills { --bs-nav-pills-link-active-bg: var(--navy); }
.nav-pills .nav-link { border-radius: 999px; color: var(--muted); font-weight: 500; }
.nav-tabs { --bs-nav-tabs-border-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 500; border: 0; border-bottom: 3px solid transparent; }
.nav-tabs .nav-link.active { color: var(--navy); border-bottom-color: var(--orange); background: transparent; }
.nav-tabs .nav-link:hover:not(.active) { color: var(--ink); border-bottom-color: var(--line); }
.pagination { --bs-pagination-active-bg: var(--navy); --bs-pagination-active-border-color: var(--navy); --bs-pagination-color: var(--navy); --bs-pagination-border-radius: 8px; }
.progress { --bs-progress-bg: var(--navy-100); border-radius: 999px; }
.form-control, .form-select { border-radius: 10px; border-color: #d7ddea; padding: .55rem .8rem; }
.form-control-sm, .form-select-sm { border-radius: 8px; padding: .3rem .6rem; }
.form-control:focus, .form-select:focus { border-color: var(--navy); box-shadow: 0 0 0 .2rem rgba(33, 61, 119, .14); }
.form-check-input:checked { background-color: var(--navy); border-color: var(--navy); }
.form-check-input:focus { box-shadow: 0 0 0 .2rem rgba(33, 61, 119, .14); }
.form-label { font-weight: 600; font-size: .82rem; color: #2e3650; }
.input-group-text { background: var(--navy-50); border-color: #d7ddea; color: var(--muted); border-radius: 10px; }
.badge { font-weight: 600; letter-spacing: .01em; border-radius: 6px; padding: .38em .6em; }
.alert { border-radius: var(--radius); border: 0; box-shadow: var(--shadow-sm); }
.alert-success { background: #e4f6ec; color: #0d5c34; }
.alert-danger { background: #fde8e6; color: #8f1d17; }
.alert-warning { background: #fff3dd; color: #7a4a00; }
.alert-info { background: var(--navy-50); color: var(--navy-900); }
.dropdown-menu { border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: .4rem; }
.dropdown-item { border-radius: 8px; padding: .45rem .75rem; }
.modal-content { border: 0; border-radius: 18px; box-shadow: 0 20px 50px rgba(20, 38, 77, .25); }
.modal-header, .modal-footer { border-color: var(--line); }

/* ---------- Structure ---------- */
.app-shell { display: flex; min-height: 100vh; }
.sidebar { width: 268px; background: var(--navy-900); color: #b9c4dc; flex-shrink: 0; }
@media (min-width: 992px) { .sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .15); border-radius: 3px; }
.sidebar-brand { display: flex; align-items: center; gap: .75rem; padding: 1.15rem 1rem; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.brand-mark { width: 42px; height: 42px; border-radius: 12px; background: var(--orange); color: #fff; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.brand-logo { width: 42px; height: 42px; object-fit: contain; border-radius: 10px; background: #fff; padding: 3px; flex-shrink: 0; }
.brand-text strong { display: block; color: #fff; font-size: .9rem; line-height: 1.2; }
.brand-text small { color: #9fb0d2; font-size: .74rem; }
.year-chip { display: inline-block; margin-top: 3px; background: rgba(234, 91, 44, .18); color: #ffb592; border-radius: 999px; padding: 1px 8px; font-size: .7rem; font-weight: 600; }
.sidebar-nav { padding: .6rem .7rem 2rem; }
.nav-section { text-transform: uppercase; font-size: .66rem; letter-spacing: .09em; color: #7f90b5; padding: 1.1rem .75rem .35rem; font-weight: 700; }
.sidebar .nav-link { display: flex; align-items: center; gap: .7rem; color: #c3cde3; padding: .5rem .75rem; border-radius: 10px; font-size: .86rem; transition: background .15s, color .15s; }
.sidebar .nav-link i { font-size: 1.02rem; width: 1.15rem; color: #8ea0c6; transition: color .15s; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar .nav-link:hover i { color: #fff; }
.sidebar .nav-link.active { background: rgba(255, 255, 255, .11); color: #fff; font-weight: 600; }
.sidebar .nav-link.active i { color: var(--orange); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: .75rem; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(8px); padding: .65rem 1.5rem; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.topbar-title { font-weight: 700; font-size: 1.05rem; }
.topbar-date { color: var(--muted); font-size: .8rem; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--orange); color: #fff; display: grid; place-items: center; font-weight: 700; }
.user-btn { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: .2rem .7rem .2rem .25rem; }
.user-btn:hover { background: var(--navy-50); }
.content { padding: 1.6rem; max-width: 1480px; width: 100%; }
@media (max-width: 576px) { .content { padding: 1rem; } .topbar { padding: .6rem 1rem; } }

/* ---------- Cartes & statistiques ---------- */
.card { border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-header { background: #fff; border-bottom: 1px solid var(--line); font-weight: 700; padding: .9rem 1.15rem; border-radius: var(--radius) var(--radius) 0 0 !important; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; font-size: .92rem; }
.card-footer { border-color: var(--line); border-radius: 0 0 var(--radius) var(--radius) !important; }
a.card { transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #cfd7e8; }
.stat { display: flex; align-items: center; gap: 1rem; }
.stat-icon { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.35rem; flex-shrink: 0; }
.stat-value { font-size: 1.55rem; font-weight: 800; line-height: 1.1; font-family: 'Plus Jakarta Sans', 'Inter', sans-serif; }
.stat-label { color: var(--muted); font-size: .8rem; font-weight: 500; }
.stat-card { position: relative; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -28px; bottom: -28px; width: 96px; height: 96px; border-radius: 50%; background: currentColor; opacity: .05; }
.bg-soft-primary { background: var(--navy-100); color: var(--navy); }
.bg-soft-accent { background: var(--orange-100); color: var(--orange-700); }
.bg-soft-success { background: #e2f5ea; color: #13824a; }
.bg-soft-warning { background: #fff2d9; color: #a86200; }
.bg-soft-danger { background: #fde6e4; color: #c0281f; }
.bg-soft-info { background: #e0f2fa; color: #0b6f99; }

/* Bannière d'accueil du tableau de bord */
.hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 18px; padding: 1.6rem 1.8rem; box-shadow: var(--shadow); }
.hero h1 { color: #fff; font-size: 1.55rem; font-weight: 800; margin: 0; }
.hero .hero-sub { color: #c9d4ec; font-size: .9rem; margin-top: .25rem; }
.hero .shape { position: absolute; pointer-events: none; }
.hero .shape-1 { right: -40px; top: -60px; width: 220px; height: 220px; background: rgba(255, 255, 255, .07); transform: rotate(28deg); border-radius: 28px; }
.hero .shape-2 { right: -36px; bottom: -86px; width: 120px; height: 120px; background: var(--orange); opacity: .9; transform: skewY(-20deg); border-radius: 18px; }
.hero .btn-light { --bs-btn-bg: #fff; --bs-btn-color: var(--navy); font-weight: 600; }
.hero .btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .06); }
.hero .btn-ghost:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.hero > * { position: relative; }

/* ---------- Tableaux ---------- */
.table { --bs-table-hover-bg: var(--navy-50); --bs-table-border-color: var(--line); margin-bottom: 0; }
.table > thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; background: #f8f9fc; border-bottom-width: 1px; white-space: nowrap; padding-top: .75rem; padding-bottom: .75rem; }
.table td { vertical-align: middle; padding-top: .7rem; padding-bottom: .7rem; }
.table code { color: var(--orange-700); background: var(--orange-100); padding: .1rem .4rem; border-radius: 5px; font-size: .82em; }
.list-group-item { border-color: var(--line); }
.card > .table-responsive:last-child, .card > .table:last-child { border-radius: 0 0 var(--radius) var(--radius); overflow: hidden; }

/* ---------- En-têtes de page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-bottom: 1.35rem; }
.page-head h1 { font-size: 1.4rem; font-weight: 800; margin: 0; }
.page-head h1 i { color: var(--orange) !important; }
.photo-sm { width: 38px; height: 38px; border-radius: 50%; object-fit: cover; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--line); }
.photo-lg { width: 112px; height: 112px; border-radius: 18px; object-fit: cover; border: 4px solid #fff; box-shadow: var(--shadow); }
.grade-input { max-width: 90px; }
.tt-grid td { min-width: 120px; height: 64px; }
.tt-slot { border-radius: 9px; padding: .4rem .55rem; font-size: .78rem; color: #fff; box-shadow: var(--shadow-sm); }
.status-radio .btn { font-size: .78rem; padding: .25rem .6rem; }
.empty-state { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty-state i { font-size: 2.4rem; color: #b8c4de; display: block; margin-bottom: .5rem; }

/* ---------- Connexion ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); background: #fff; }
.auth-side { position: relative; overflow: hidden; background: var(--navy); color: #fff; padding: 3rem; display: flex; flex-direction: column; }
.auth-side .shape { position: absolute; pointer-events: none; }
.auth-side .s1 { right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 40px; background: rgba(255, 255, 255, .06); transform: rotate(32deg); }
.auth-side .s2 { left: -70px; bottom: -40px; width: 180px; height: 220px; background: var(--orange); transform: skewY(-24deg); border-radius: 22px; opacity: .92; }
.auth-side .s3 { right: 18%; bottom: -60px; width: 160px; height: 160px; border-radius: 50%; background: rgba(255, 255, 255, .05); }
.auth-side > *:not(.shape) { position: relative; }
.auth-logo { display: flex; align-items: center; gap: .8rem; }
.auth-logo img { height: 52px; background: #fff; border-radius: 12px; padding: 5px 8px; }
h1, h2, h3, h4, h5, h6 { color: inherit; }
.auth-title { color: #fff; font-family: 'Plus Jakarta Sans', sans-serif; font-size: 2.5rem; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: auto 0 1rem; max-width: 520px; }
.auth-lead { color: #cdd7ee; font-size: 1.02rem; max-width: 480px; }
.auth-features { list-style: none; padding: 0; margin: 1.6rem 0 2.2rem; display: grid; gap: .8rem; max-width: 480px; }
.auth-features li { display: flex; gap: .75rem; align-items: center; color: #e6ecf8; }
.auth-features i { width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, .1); display: grid; place-items: center; color: #ffb592; flex-shrink: 0; }
.auth-foot { color: #9fb0d2; font-size: .8rem; margin-top: auto; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.5rem; background: var(--surface); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 2.4rem; box-shadow: var(--shadow); }
.auth-card h2 { color: var(--ink); font-size: 1.45rem; font-weight: 800; margin-bottom: .3rem; }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { padding: 2rem 1.5rem; }
    .auth-title { font-size: 1.8rem; margin-top: 1.5rem; }
    .auth-features, .auth-foot, .auth-side .s2, .auth-side .s3 { display: none; }
    .auth-card { padding: 1.8rem; }
}

/* ---------- Portail parents ---------- */
.portal-nav { background: #fff; border-bottom: 1px solid var(--line); }
.portal-hero { position: relative; overflow: hidden; background: var(--navy); color: #fff; border-radius: 20px; padding: 1.8rem; margin-bottom: 1.5rem; }
.portal-hero h1 { color: #fff; font-size: 1.6rem; font-weight: 800; margin: 0; }
.portal-hero p { color: #c9d4ec; margin: .3rem 0 0; }
.portal-hero .shape { position: absolute; right: -30px; bottom: -50px; width: 170px; height: 170px; background: var(--orange); transform: skewY(-22deg); border-radius: 22px; opacity: .9; }
.child-card .card-body { padding: 1.2rem; }
.child-card .photo-lg { width: 76px; height: 76px; border-radius: 50%; }
.section-title { font-family: 'Plus Jakarta Sans', sans-serif; font-weight: 800; font-size: 1.05rem; margin: 0 0 .8rem; }

@media print { .sidebar, .topbar, .no-print { display: none !important; } .content { padding: 0; } body { background: #fff; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* === HAMS-CHARTE-ECOLE : charte commune HAMS (phase 3, 15/11/2026) ===
   Bleu marine HAMIDOUSIF pour la marque, orange pour l'action, bleu HAMS School pour l'accent.
   Référence : « Charte HAMS ». Supprimer ce bloc = retour aux couleurs d'origine. */
:root {
  --navy: #263371;
  --navy-900: #131a42;
  --navy-800: #1b2559;
  --navy-100: #e8ebf7;
  --navy-50: #f3f5fb;
  --orange: #ea5a2a;
  --orange-700: #c2410c;
  --ecole: #1d4ed8;
  --line: #dfe3f0;
  --ink: #1c2233;
  --bs-primary: #263371; --bs-primary-rgb: 38, 51, 113;
  --bs-link-color: #263371; --bs-link-color-rgb: 38, 51, 113;
  --bs-link-hover-color: #c2410c; --bs-link-hover-color-rgb: 194, 65, 12;
}
:focus-visible { outline: 3px solid #263371; outline-offset: 2px; }
.btn-primary {
  --bs-btn-bg: var(--orange-700); --bs-btn-border-color: var(--orange-700);
  --bs-btn-hover-bg: #9a3412; --bs-btn-hover-border-color: #9a3412;
  --bs-btn-active-bg: #7c2d12; --bs-btn-active-border-color: #7c2d12;
  --bs-btn-disabled-bg: var(--orange-700); --bs-btn-disabled-border-color: var(--orange-700);
  --bs-btn-color: #fff; --bs-btn-hover-color: #fff; --bs-btn-active-color: #fff;
  box-shadow: 0 2px 8px rgba(194, 65, 12, .3);
}
.btn-outline-primary { --bs-btn-border-color: #263371; }
.sidebar { background: radial-gradient(120% 60% at 0% 0%, #263371 0%, #131a42 65%); }
.sidebar .nav-link.active { background: var(--ecole); color: #fff; box-shadow: inset 3px 0 0 #fcd34d; }
.sidebar .nav-link.active i { color: #fff; }
.hero, .portal-hero, .auth-side { background: linear-gradient(135deg, #263371 0%, #1b2559 100%); }
.nav-tabs .nav-link.active { border-bottom-color: var(--ecole); }
/* === fin HAMS-CHARTE-ECOLE === */
