/* =====================================================================
   CHKS Al Mouhamadiya — Design system
   Palette : vert islamique profond + or, glassmorphism léger
   ===================================================================== */
:root {
  --vert:        #0e6b45;
  --vert-fonce:  #0a4f33;
  --vert-nuit:   #073927;
  --vert-clair:  #16916a;
  --or:          #e0a82e;
  --or-clair:    #f3c65a;
  --bleu-ciel:   #bfe3ea;
  --fond:        #eef3f0;
  --carte:       #ffffff;
  --texte:       #1d2b25;
  --texte-doux:  #64766e;
  --ombre:       0 6px 24px rgba(10,79,51,.09);
  --ombre-forte: 0 12px 40px rgba(10,79,51,.18);
  --radius:      16px;
  --radius-sm:   11px;
  --sidebar-w:   256px;
  --grad-vert:   linear-gradient(135deg, var(--vert-fonce), var(--vert) 55%, var(--vert-clair));
  --grad-or:     linear-gradient(135deg, var(--or), var(--or-clair));
}

* { box-sizing: border-box; }
body {
  background: var(--fond);
  color: var(--texte);
  font-family: 'Plus Jakarta Sans', 'Segoe UI', system-ui, sans-serif;
  margin: 0;
}

/* ================= STRUCTURE APP ================= */
.app-shell { display: flex; min-height: 100vh; }
.main-wrap { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.content { padding: 26px 30px; flex: 1; }

/* ================= SIDEBAR ================= */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--grad-vert);
  position: sticky; top: 0; height: 100vh;
  padding: 20px 14px; color: #fff; overflow-y: auto;
  box-shadow: 4px 0 24px rgba(7,57,39,.22);
  z-index: 50;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); border-radius: 3px; }

.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none; color: #fff; padding: 6px 8px 20px;
  border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 14px;
}
.brand-badge {
  width: 44px; height: 44px; border-radius: 13px;
  background: var(--grad-or); color: var(--vert-nuit);
  display: grid; place-items: center; font-size: 1.5rem;
  box-shadow: 0 6px 16px rgba(224,168,46,.4); flex-shrink: 0;
}
.brand-text { font-weight: 800; font-size: 1.25rem; line-height: 1.05; display: flex; flex-direction: column; }
.brand-text small { font-weight: 500; opacity: .75; font-size: .68rem; letter-spacing: .5px; }

.side-nav { list-style: none; padding: 0; margin: 0; }
.side-cat {
  font-size: .68rem; text-transform: uppercase; letter-spacing: 1.2px;
  color: rgba(255,255,255,.45); font-weight: 700;
  padding: 16px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 13px; margin: 2px 0; border-radius: 12px;
  color: rgba(255,255,255,.82); text-decoration: none;
  font-weight: 600; font-size: .92rem; position: relative;
  transition: all .2s ease;
}
.side-link i { font-size: 1.15rem; width: 22px; text-align: center; }
.side-link:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateX(3px); }
.side-link.active { background: rgba(255,255,255,.16); color: #fff; }
.side-link.active::before {
  content: ''; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 60%; background: var(--or); border-radius: 0 4px 4px 0;
}
.side-badge {
  margin-left: auto; background: var(--or); color: var(--vert-nuit);
  font-size: .7rem; font-weight: 800; padding: 1px 8px; border-radius: 20px;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge { 0%,100% { box-shadow: 0 0 0 0 rgba(224,168,46,.6); } 50% { box-shadow: 0 0 0 6px rgba(224,168,46,0); } }

.side-foot {
  margin-top: 18px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.12);
  display: flex; align-items: center; gap: 10px;
}
.side-user { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.avatar {
  width: 40px; height: 40px; border-radius: 11px; flex-shrink: 0;
  background: var(--grad-or); color: var(--vert-nuit);
  display: grid; place-items: center; font-weight: 800; font-size: .9rem;
}
.side-user-info { display: flex; flex-direction: column; min-width: 0; }
.side-user-info strong { font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.role-chip {
  font-size: .68rem; background: rgba(255,255,255,.16); color: #fff;
  padding: 1px 8px; border-radius: 20px; width: fit-content; text-transform: capitalize; margin-top: 2px;
}
.btn-logout {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: rgba(255,255,255,.1); color: #fff; display: grid; place-items: center;
  text-decoration: none; transition: all .2s;
}
.btn-logout:hover { background: #d9534f; color: #fff; }

/* ================= TOPBAR ================= */
.topbar {
  height: 70px; background: rgba(255,255,255,.85); backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 16px; padding: 0 30px;
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid rgba(10,79,51,.07);
}
.btn-burger { display: none; background: none; border: none; font-size: 1.5rem; color: var(--vert); }
.topbar-hello { display: flex; flex-direction: column; line-height: 1.15; }
.hello-sub { font-size: .78rem; color: var(--texte-doux); }
.hello-name { font-weight: 800; font-size: 1.15rem; color: var(--vert-fonce); }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.topbar-icon {
  width: 44px; height: 44px; border-radius: 13px; border: none;
  background: var(--fond); color: var(--vert); font-size: 1.2rem;
  display: grid; place-items: center; cursor: pointer; text-decoration: none;
  position: relative; transition: all .2s;
}
.topbar-icon:hover { background: var(--vert); color: #fff; transform: translateY(-2px); }

/* ================= CLOCHE ================= */
.notif-wrap { position: relative; }
.notif-bell.has-notif i { animation: bell-idle 3s ease-in-out infinite; }
@keyframes bell-idle { 0%,88%,100% { transform: rotate(0); } 90% { transform: rotate(12deg); } 94% { transform: rotate(-10deg); } 97% { transform: rotate(6deg); } }
.notif-bell.shake i { animation: bell-shake .8s cubic-bezier(.36,.07,.19,.97); }
@keyframes bell-shake {
  0%,100% { transform: rotate(0); }
  10%,30%,50%,70% { transform: rotate(-16deg); }
  20%,40%,60%,80% { transform: rotate(16deg); }
}
.notif-count {
  position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px;
  background: linear-gradient(135deg,#ff5b5b,#e23b3b); color: #fff;
  font-size: .68rem; font-weight: 800; border-radius: 20px;
  display: grid; place-items: center; padding: 0 5px;
  border: 2px solid #fff; box-shadow: 0 2px 8px rgba(226,59,59,.5);
}
.notif-panel {
  position: absolute; top: calc(100% + 12px); right: 0; width: 370px; max-width: 92vw;
  background: #fff; border-radius: var(--radius); box-shadow: var(--ombre-forte);
  overflow: hidden; animation: pop-in .22s ease; z-index: 60;
  border: 1px solid rgba(10,79,51,.06);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-8px) scale(.97); } to { opacity: 1; transform: none; } }
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; background: var(--grad-vert); color: #fff;
}
.notif-head strong { font-size: .98rem; }
.notif-allread { background: rgba(255,255,255,.2); border: none; color: #fff; font-size: .74rem; font-weight: 600; padding: 5px 11px; border-radius: 20px; cursor: pointer; transition: background .2s; }
.notif-allread:hover { background: rgba(255,255,255,.35); }
.notif-list { max-height: 400px; overflow-y: auto; }
.notif-item {
  display: flex; gap: 12px; padding: 13px 16px; text-decoration: none; color: var(--texte);
  border-bottom: 1px solid #f0f3f1; position: relative; transition: background .15s;
}
.notif-item:hover { background: #f6faf8; }
.notif-item.non-lue { background: #f0f9f4; }
.notif-ic {
  width: 42px; height: 42px; border-radius: 12px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 1.15rem; color: #fff;
}
.ic-inscription { background: linear-gradient(135deg,#3a8dde,#2f6fb8); }
.ic-paiement_en_ligne { background: linear-gradient(135deg,#e0a82e,#d18f14); }
.ic-paiement { background: linear-gradient(135deg,#16916a,#0e6b45); }
.ic-discipline { background: linear-gradient(135deg,#e2603b,#c8442a); }
.ic-systeme { background: linear-gradient(135deg,#7a8a83,#5a6a63); }
.notif-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.notif-body strong { font-size: .87rem; }
.notif-msg { font-size: .8rem; color: var(--texte-doux); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notif-time { font-size: .7rem; color: #9aa8a2; }
.notif-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--or); align-self: center; flex-shrink: 0; box-shadow: 0 0 0 3px rgba(224,168,46,.2); }
.notif-empty { padding: 40px 20px; text-align: center; color: var(--texte-doux); font-size: .9rem; }
.notif-empty i { font-size: 1.6rem; opacity: .5; }

/* ================= CARTES & TITRES ================= */
.card-chks {
  border: none; border-radius: var(--radius); background: var(--carte);
  box-shadow: var(--ombre); overflow: hidden;
}
h3.fw-bold { color: var(--vert-fonce); letter-spacing: -.5px; }
.section-title { position: relative; padding-bottom: .5rem; color: var(--vert-fonce); }
.section-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 64px; height: 4px; background: var(--grad-or); border-radius: 2px; }

/* ================= BOUTONS ================= */
.btn-chks { background: var(--grad-vert); color: #fff; border: none; font-weight: 600; border-radius: 11px; padding: 9px 18px; transition: all .2s; box-shadow: 0 4px 14px rgba(14,107,69,.25); }
.btn-chks:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(14,107,69,.35); }
.btn-outline-success { border-radius: 11px; font-weight: 600; }

/* ================= STAT CARDS (dashboard) ================= */
.stat-card {
  background: var(--carte); border-radius: var(--radius); padding: 20px;
  display: flex; gap: 16px; align-items: center; height: 100%;
  box-shadow: var(--ombre); position: relative; overflow: hidden;
  transition: transform .25s, box-shadow .25s;
}
.stat-card::after { content: ''; position: absolute; right: -20px; top: -20px; width: 90px; height: 90px; border-radius: 50%; background: rgba(14,107,69,.05); }
.stat-card:hover { transform: translateY(-5px); box-shadow: var(--ombre-forte); }
.stat-card i { font-size: 1.5rem; width: 56px; height: 56px; border-radius: 15px; display: grid; place-items: center; color: #fff; background: var(--grad-vert); flex-shrink: 0; z-index: 1; }
.stat-card h4 { margin: 0; font-weight: 800; font-size: 1.5rem; color: var(--vert-fonce); }
.stat-card span { color: var(--texte-doux); font-size: .84rem; font-weight: 500; }
.stat-card.warn i { background: linear-gradient(135deg,#e2603b,#c8442a); }
.stat-card.gold i { background: var(--grad-or); color: var(--vert-nuit); }
.stat-card.gold h4 { font-size: 1.15rem; }
.stat-card.blue i { background: linear-gradient(135deg,#3a8dde,#2f6fb8); }

/* ================= TABLEAUX ================= */
.table { margin: 0; }
.table > :not(caption) > * > * { padding: 13px 16px; }
.table thead th { background: #f4f8f6; color: var(--vert-fonce); font-weight: 700; font-size: .8rem; text-transform: uppercase; letter-spacing: .4px; border: none; }
.table tbody tr { border-color: #f0f3f1; transition: background .15s; }
.table-hover tbody tr:hover { background: #f6faf8; }
.badge { font-weight: 600; padding: .4em .7em; border-radius: 7px; }

/* ================= FORMULAIRES ================= */
.form-control, .form-select { border-radius: 10px; border: 1.5px solid #e3eae6; padding: 10px 13px; transition: all .18s; }
.form-control:focus, .form-select:focus { border-color: var(--vert-clair); box-shadow: 0 0 0 3px rgba(22,145,106,.13); }
.form-label { font-weight: 600; font-size: .87rem; color: var(--vert-fonce); margin-bottom: 5px; }

/* ================= ALERTES ================= */
.alert { border-radius: var(--radius-sm); border: none; font-weight: 500; }
.alert-success { background: #e5f5ec; color: #0e6b45; }
.alert-danger { background: #fdeaea; color: #c0392b; }
.alert-warning { background: #fef5e3; color: #a06a00; }
.alert-info { background: #e6f3fa; color: #1c6ea0; }

/* ================= TEXTE ARABE ================= */
.arabe { font-family: 'Traditional Arabic','Amiri',serif; font-size: 1.15em; }
.reglement-list li { margin-bottom: 1rem; }

/* ================= REÇU / IMPRESSION ================= */
.recu { font-family: 'Courier New', monospace; border: 1px dashed #333; }
.bulletin { border: 1px solid #ddd; border-radius: 8px; }
@media print {
  .no-print, .sidebar, .topbar,
  .navbar, .footer-chks, footer,
  .eleve-topbar, .eleve-nav-mobile { display: none !important; }
  body { background: #fff; }
  .content { padding: 0; }
  .eleve-main, .eleve-body { padding: 0; }
  .recu { border: none; box-shadow: none !important; }
  .bulletin { border: none; border-radius: 0; }
  .page-bulletin { page-break-after: always; }
  .page-bulletin:last-child { page-break-after: auto; }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 992px) {
  .sidebar { position: fixed; top: 0; bottom: 0; z-index: 1050; left: calc(-1 * var(--sidebar-w) - 10px); transition: left .28s ease; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  body.sidebar-open .sidebar { left: 0; }
  .btn-burger { display: block; }
  .content { padding: 18px; }
  .topbar { padding: 0 16px; }
  /* Overlay sombre quand le menu est ouvert */
  .sidebar-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 1040; opacity: 0; visibility: hidden; transition: opacity .28s ease; }
  body.sidebar-open .sidebar-overlay { opacity: 1; visibility: visible; }
}

/* ---- Ajustements mobiles généraux ---- */
@media (max-width: 768px) {
  .topbar-hello .hello-sub { font-size: .72rem; }
  .content { padding: 14px; }
  /* Cartes plus compactes */
  .card-chks { border-radius: 14px; }
  /* Titres de page plus petits */
  .content h3 { font-size: 1.35rem; }
  /* Boutons pleine largeur plus faciles à toucher */
  .btn { min-height: 40px; }
  /* Tableaux : autoriser le scroll horizontal partout */
  .table-responsive { -webkit-overflow-scrolling: touch; }
  table { font-size: .9rem; }
  /* Notif panel : pleine largeur sur mobile */
  .notif-panel { position: fixed !important; top: 60px; right: 8px; left: 8px; width: auto !important; }
  /* Grille d'appel présences : boutons empilables */
  .appel-group { flex-wrap: wrap; }
  .appel-group .btn { flex: 1 1 30%; font-size: .78rem; }
  /* Emploi du temps : cases plus petites */
  .emploi-cell { min-width: 96px; }
  .creneau strong { font-size: .74rem; }
  .creneau small { font-size: .62rem; }
  /* Hero dashboard : empiler */
  .dash-hero { padding: 20px; }
  .dash-hero-quote { display: none; }
}

@media (max-width: 480px) {
  .content { padding: 10px; }
  .topbar-hello .hello-name { font-size: 1rem; }
  .stat-card { padding: 14px; }
  h3 { font-size: 1.2rem; }
  /* Réduire encore les tableaux denses */
  table { font-size: .82rem; }
  .btn-sm { font-size: .74rem; padding: .3rem .5rem; }
}

/* ================= SITE PUBLIC ================= */
.navbar-chks { background: var(--grad-vert); box-shadow: 0 2px 16px rgba(7,57,39,.2); }
.navbar-chks .nav-link { font-weight: 600; }
.footer-chks { background: var(--vert-nuit); }
.hero-chks { background: var(--grad-vert); position: relative; overflow: hidden; }
.hero-chks::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 80% 20%, rgba(224,168,46,.18), transparent 45%); }
.hero-chks > .container { position: relative; z-index: 1; }

/* ================= DASHBOARD HERO ================= */
.dash-hero {
  background: var(--grad-vert); border-radius: var(--radius); padding: 26px 30px;
  color: #fff; display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px; position: relative; overflow: hidden;
  box-shadow: var(--ombre);
}
.dash-hero::after { content: '\F02E'; font-family: 'bootstrap-icons'; position: absolute; right: 24px; bottom: -18px; font-size: 8rem; opacity: .08; }
.dash-hero-text h3 { color: #fff; }
.dash-hero-text p { opacity: .82; }
.dash-hero-quote { background: rgba(255,255,255,.12); border-radius: 12px; padding: 10px 18px; font-style: italic; font-weight: 500; backdrop-filter: blur(4px); z-index: 1; }
.dash-hero-quote i { color: var(--or-clair); }

/* =====================================================================
   ESPACE ÉLÈVE
   ===================================================================== */
.eleve-body { background: var(--fond); min-height: 100vh; padding-bottom: 70px; }
.eleve-topbar {
  background: var(--grad-vert); color: #fff; padding: 12px 0;
  position: sticky; top: 0; z-index: 40; box-shadow: 0 3px 16px rgba(7,57,39,.2);
}
.eleve-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: #fff; }
.eleve-brand .brand-text { display: flex; flex-direction: column; font-weight: 800; line-height: 1.05; }
.eleve-brand .brand-text small { font-weight: 500; opacity: .75; font-size: .68rem; }
.eleve-nav { display: flex; gap: 6px; }
.eleve-nav a { color: rgba(255,255,255,.85); text-decoration: none; font-weight: 600; font-size: .9rem; padding: 8px 14px; border-radius: 10px; transition: all .2s; }
.eleve-nav a:hover, .eleve-nav a.active { background: rgba(255,255,255,.16); color: #fff; }
.eleve-user { display: flex; align-items: center; gap: 9px; padding-left: 8px; }
.eleve-user div { display: flex; flex-direction: column; line-height: 1.1; }
.eleve-user strong { font-size: .85rem; } .eleve-user small { font-size: .7rem; opacity: .75; }
.eleve-topbar .topbar-icon { background: rgba(255,255,255,.14); color: #fff; }
.eleve-topbar .topbar-icon:hover { background: rgba(255,255,255,.28); }
.eleve-topbar .btn-logout { background: rgba(255,255,255,.14); }
.eleve-main { padding: 26px 0; }

.eleve-nav-mobile {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: #fff; box-shadow: 0 -3px 16px rgba(0,0,0,.08);
  display: flex; justify-content: space-around; padding: 6px 0;
}
.eleve-nav-mobile a { flex: 1; text-align: center; color: var(--texte-doux); text-decoration: none; font-size: .68rem; padding: 6px 0; }
.eleve-nav-mobile a i { font-size: 1.25rem; display: block; }
.eleve-nav-mobile a.active { color: var(--vert); }
.eleve-nav-mobile a span { display: block; }

/* Login élève */
.eleve-login { min-height: 100vh; display: grid; place-items: center; padding: 20px; background: var(--grad-vert); }
.eleve-login-card { background: #fff; border-radius: var(--radius); box-shadow: var(--ombre-forte); padding: 36px 30px; width: 100%; max-width: 420px; }
.eleve-login .brand-badge { display: grid; }

/* Hero élève */
.eleve-hero { background: var(--grad-vert); border-radius: var(--radius); padding: 26px 30px; color: #fff; display: flex; justify-content: space-between; align-items: center; box-shadow: var(--ombre); }
.eleve-hero .hero-badge { background: rgba(255,255,255,.16); padding: 5px 13px; border-radius: 20px; font-size: .8rem; font-weight: 600; }
.eleve-hero .hero-avatar { width: 64px; height: 64px; border-radius: 18px; background: var(--grad-or); color: var(--vert-nuit); display: grid; place-items: center; font-weight: 800; font-size: 1.5rem; flex-shrink: 0; }

.info-table th { color: var(--texte-doux); font-weight: 600; width: 42%; }
.info-table td { font-weight: 500; }

.result-tile { display: flex; align-items: center; gap: 12px; padding: 13px 15px; background: var(--fond); border-radius: 12px; text-decoration: none; color: var(--texte); transition: all .2s; }
.result-tile:hover { background: #e5f5ec; transform: translateX(3px); }
.result-tile .rt-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--grad-or); color: var(--vert-nuit); display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.result-tile .rt-text { display: flex; flex-direction: column; flex: 1; }
.result-tile .rt-text small { color: var(--texte-doux); font-size: .74rem; }
.result-tile > .bi-chevron-right { color: var(--texte-doux); }

/* =====================================================================
   EMPLOIS DU TEMPS
   ===================================================================== */
.emploi-card { display: block; background: #fff; border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--texte); box-shadow: var(--ombre); transition: all .25s; }
.emploi-card:hover { transform: translateY(-5px); box-shadow: var(--ombre-forte); }
.emploi-card .ec-top { display: flex; justify-content: space-between; align-items: center; }
.emploi-card .ec-icon { width: 48px; height: 48px; border-radius: 13px; color: #fff; display: grid; place-items: center; font-size: 1.3rem; }

.emploi-grille { border-collapse: separate; border-spacing: 0; }
.emploi-grille th { background: #f4f8f6; color: var(--vert-fonce); font-weight: 700; font-size: .82rem; text-align: center; }
.emploi-heure { font-weight: 700; color: var(--vert-fonce); text-align: center; font-size: .8rem; background: #f9fbfa; white-space: nowrap; }
.emploi-cell { padding: 5px !important; vertical-align: middle; min-width: 130px; }
.creneau { position: relative; background: #fff; border: 1px solid #eef2f0; border-left: 4px solid var(--vert); border-radius: 9px; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.creneau strong { font-size: .82rem; color: var(--texte); }
.creneau small { font-size: .68rem; color: var(--texte-doux); }
.creneau-del { position: absolute; top: 3px; right: 3px; }
.creneau .btn-del { background: none; border: none; color: #c0392b; opacity: .5; padding: 0 3px; font-size: .9rem; line-height: 1; cursor: pointer; }
.creneau .btn-del:hover { opacity: 1; }

@media print {
  .attestation, .bulletin { border: none !important; }
}

/* ================= PRÉSENCES / ASSIDUITÉ ================= */
.appel-group .btn { flex: 1; }
.appel-group .btn-check:checked + .btn-outline-success { background: var(--vert); border-color: var(--vert); color: #fff; }
.appel-group .btn-check:checked + .btn-outline-danger { background: #dc3545; border-color: #dc3545; color: #fff; }
.appel-group .btn-check:checked + .btn-outline-warning { background: #e0a82e; border-color: #e0a82e; color: #fff; }
.assiduite-tile { background: var(--fond); border-radius: 12px; padding: 14px; text-align: center; }
.assiduite-tile .at-num { display: block; font-size: 1.6rem; font-weight: 800; line-height: 1; }
.assiduite-tile .at-lib { font-size: .78rem; color: var(--texte-doux); }

/* ================= BANDEAU IDENTIFIANTS ================= */
.ident-box { background: rgba(255,255,255,.16); border-radius: 10px; padding: 8px 16px; }
.ident-box small { display: block; font-size: .72rem; opacity: .85; }
.ident-box strong { font-size: 1.15rem; letter-spacing: .5px; }

/* ================= GUIDE CONFIG EMAIL ================= */
.config-steps { padding-left: 20px; }
.config-steps li { margin-bottom: 14px; line-height: 1.5; }
.code-block { background: #0a1f16; color: #d4f0e2; border-radius: 10px; padding: 14px 16px; margin-top: 8px; font-family: 'Courier New', monospace; font-size: .82rem; white-space: pre; overflow-x: auto; }
.code-block .hl { color: #f3c65a; font-weight: 700; }
.code-block .cm { color: #6a8a7a; font-style: italic; }

/* ================= REÇU & FACTURE (lisibilité) ================= */
.recu { font-family: 'Segoe UI', system-ui, sans-serif; border: 2px solid #1a1a1a; color: #111; }
.recu-titre { font-size: 1.25rem; font-weight: 800; letter-spacing: 2px; }
.recu-table th, .facture-table th {
  color: #444; font-weight: 600; font-size: .9rem; width: 42%;
  border: none; padding: 7px 8px; vertical-align: top;
}
.recu-table td, .facture-table td { font-size: .98rem; border: none; padding: 7px 8px; color: #111; }
.recu-table tr, .facture-table tr { border-bottom: 1px solid #e8e8e8; }
.recu-table.recap tr { border-bottom: 1px solid #d0d0d0; }
.montant-box { border: 2px solid #0e6b45; border-radius: 12px; padding: 14px; background: #f2fbf6; }
.montant-label { font-size: .85rem; font-weight: 700; letter-spacing: 1.5px; color: #0a4f33; }
.montant-valeur { font-size: 2rem; font-weight: 800; color: #0e6b45; line-height: 1.1; }
@media print {
  .recu { border: 2px solid #000; box-shadow: none !important; }
  .montant-box { background: #fff !important; -webkit-print-color-adjust: exact; }
}

/* ================= CHAMP MOT DE PASSE (œil) ================= */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 44px !important; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--texte-doux); cursor: pointer;
  width: 34px; height: 34px; border-radius: 8px; display: grid; place-items: center;
  font-size: 1.05rem; transition: color .15s, background .15s;
}
.pwd-eye:hover { color: var(--vert); background: rgba(14,107,69,.08); }
/* Cas des input-group (connexion) : positionner l'œil correctement */
.input-group .pwd-wrap { flex: 1 1 auto; width: 1%; }
.input-group .pwd-wrap input { border-top-left-radius: 0; border-bottom-left-radius: 0; }

/* ================= SÉLECTEUR INDICATIF PAYS ================= */
.indicatif-select { border-top-right-radius: 0 !important; border-bottom-right-radius: 0 !important; font-size: .9rem; background-color: #f8faf9; }
.input-group .indicatif-select + input { border-top-left-radius: 0; border-bottom-left-radius: 0; }
@media (max-width: 480px) {
  .indicatif-select { max-width: 110px !important; font-size: .8rem; }
}

/* ================= TARIFS PAR NIVEAU ================= */
.tarifs-table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .3px; color: var(--vert-fonce); }
.tarifs-table td { padding: 6px 8px; }
.montant-group { max-width: 150px; margin-left: auto; }
.montant-input { font-weight: 700; font-variant-numeric: tabular-nums; }
.montant-input:focus { border-color: var(--vert); box-shadow: 0 0 0 .18rem rgba(14,107,69,.15); }
.montant-group .input-group-text { font-size: .7rem; color: var(--texte-doux); background: var(--fond); }
@media (max-width: 768px) { .montant-group { max-width: 120px; } }

/* ================= INDICATEUR MOT DE PASSE ================= */
.pwd-hint { font-size: .78rem; margin-top: 4px; display: flex; align-items: center; gap: 5px; }
.pwd-hint.ok { color: var(--vert); font-weight: 600; }
.pwd-hint.ko { color: #b8860b; }


/* =====================================================================
   RÈGLEMENT INTÉRIEUR
   ===================================================================== */
.ri-page { max-width: 940px; margin: 0 auto; padding: 0 16px 60px; }

/* ---- En-tête officiel ---- */
.ri-entete {
  background: var(--grad-vert); color: #fff; border-radius: 0 0 26px 26px;
  padding: 34px 24px 30px; margin: 0 -16px 0; text-align: center; position: relative;
  overflow: hidden; box-shadow: 0 8px 30px rgba(7,57,39,.18);
}
.ri-entete::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(224,168,46,.22), transparent 46%);
}
.ri-entete > * { position: relative; }
.ri-rep { font-size: .74rem; line-height: 1.7; opacity: .82; letter-spacing: .4px; }
.ri-rep em { font-style: italic; }
.ri-titre-ecole {
  font-size: 1.28rem; font-weight: 800; margin: 16px auto 6px; max-width: 620px;
  text-transform: uppercase; letter-spacing: .6px; line-height: 1.35;
}
.ri-titre-ecole::after {
  content: ''; display: block; width: 60px; height: 3px; margin: 12px auto 0;
  background: var(--or); border-radius: 2px;
}
.ri-sous { font-size: .76rem; line-height: 1.7; opacity: .78; letter-spacing: .3px; }
.ri-badge {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 20px;
  background: var(--grad-or); color: var(--vert-nuit);
  padding: 11px 30px; border-radius: 30px; font-weight: 800;
  letter-spacing: 2px; font-size: .92rem; box-shadow: 0 6px 20px rgba(224,168,46,.3);
}

/* ---- Barre d'actions ---- */
.ri-actions {
  display: flex; gap: 10px; justify-content: center; flex-wrap: wrap;
  margin: -22px auto 34px; position: relative; z-index: 2;
  background: #fff; padding: 12px 16px; border-radius: 16px;
  box-shadow: var(--ombre); width: fit-content; max-width: 100%;
}

/* ---- Corps ---- */
.ri-corps { }
.ri-corps p { margin-bottom: 12px; text-align: justify; line-height: 1.8; color: #2b3733; }

/* Chapitres : pastille numérotée + filet or */
.ri-chapitre {
  display: flex; align-items: center; gap: 14px;
  font-size: 1rem; font-weight: 800; color: var(--vert-nuit);
  margin: 42px 0 20px; padding-bottom: 12px;
  border-bottom: 2px solid #e6ece9; text-transform: uppercase; letter-spacing: .5px;
  scroll-margin-top: 80px;
}
.ri-chap-num {
  flex: 0 0 38px; height: 38px; display: grid; place-items: center;
  background: var(--grad-vert); color: #fff; border-radius: 11px;
  font-size: 1.05rem; font-weight: 800; letter-spacing: 0;
  box-shadow: 0 4px 12px rgba(14,107,69,.28);
}
.ri-chap-txt { flex: 1; }
.ri-chapitre:first-child { margin-top: 26px; }
/* Préambule et conclusion : pas de numéro */
.ri-sans-num .ri-chap-num { background: var(--grad-or); color: var(--vert-nuit); box-shadow: 0 4px 12px rgba(224,168,46,.3); }

/* Sous-titres (cycles) */
.ri-cycle {
  display: inline-block; font-size: .82rem; font-weight: 800; color: var(--vert-fonce);
  margin: 26px 0 12px; padding: 6px 14px; background: #eef7f2;
  border-radius: 20px; text-transform: uppercase; letter-spacing: .6px;
}

/* Articles : carte avec liseré */
.ri-article {
  background: #fff; border: 1px solid #eaefec; border-left: 3px solid var(--or);
  border-radius: 10px; padding: 12px 16px; margin-bottom: 10px;
  transition: box-shadow .18s, border-left-color .18s;
}
.ri-article:hover { box-shadow: 0 3px 14px rgba(0,0,0,.06); border-left-color: var(--vert); }
.ri-num {
  display: inline-block; font-weight: 800; color: var(--vert);
  font-size: .74rem; letter-spacing: .5px; text-transform: uppercase;
  margin-right: 8px; white-space: nowrap;
}

/* Listes */
.ri-liste { margin: 6px 0 16px; padding-left: 4px; list-style: none; }
.ri-liste li {
  position: relative; padding-left: 24px; margin-bottom: 7px; line-height: 1.7; color: #2b3733;
}
.ri-liste li::before {
  content: ''; position: absolute; left: 6px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: var(--or);
}

/* Pied */
.ri-pied {
  margin-top: 40px; padding: 18px 22px;
  background: linear-gradient(135deg, #fdf6e6, #fbf1d8);
  border-left: 4px solid var(--or); border-radius: 12px;
  font-size: .87rem; color: #6a5320; line-height: 1.7;
}

/* ---- Impression ---- */
@media print {
  .ri-page { max-width: none; padding: 0; }
  .ri-entete {
    background: none !important; color: #000 !important; box-shadow: none;
    border-radius: 0; border-bottom: 3px solid #000; padding: 0 0 14px; margin: 0 0 18px;
  }
  .ri-entete::before { display: none; }
  .ri-rep, .ri-sous { opacity: 1; color: #333; }
  .ri-titre-ecole { color: #000; }
  .ri-titre-ecole::after { background: #000; }
  .ri-badge {
    background: none !important; color: #000 !important;
    border: 2px solid #000; box-shadow: none; margin-top: 12px;
  }
  .ri-chapitre {
    color: #000 !important; border-bottom: 1.5px solid #000;
    page-break-after: avoid; margin: 22px 0 12px;
  }
  .ri-chap-num {
    background: none !important; color: #000 !important;
    border: 1.5px solid #000; box-shadow: none;
  }
  .ri-cycle { background: none !important; color: #000; border: 1px solid #666; }
  .ri-article {
    border: none; border-left: 2px solid #666; border-radius: 0;
    padding: 2px 0 2px 10px; page-break-inside: avoid; box-shadow: none;
  }
  .ri-num { color: #000; }
  .ri-liste li { page-break-inside: avoid; }
  .ri-liste li::before { background: #000; }
  .ri-pied { background: none !important; border-left: 2px solid #000; color: #000; }
  .ri-corps { font-size: 10.5pt; line-height: 1.55; }
  .ri-corps p { margin-bottom: 7px; }
}

/* ---- Mobile ---- */
@media (max-width: 576px) {
  .ri-entete { padding: 26px 16px 24px; border-radius: 0 0 18px 18px; }
  .ri-titre-ecole { font-size: 1.02rem; }
  .ri-badge { font-size: .78rem; padding: 9px 20px; letter-spacing: 1.2px; }
  .ri-chapitre { font-size: .86rem; gap: 10px; margin: 30px 0 16px; }
  .ri-chap-num { flex-basis: 32px; height: 32px; font-size: .92rem; }
  .ri-corps p, .ri-liste li { font-size: .93rem; line-height: 1.7; }
  .ri-article { padding: 10px 12px; }
}

/* ---- Sommaire du règlement ---- */
.ri-somm {
  display: flex; flex-wrap: wrap; gap: 7px; align-items: center;
  background: #fff; border: 1px solid #e8ece9; border-radius: 14px;
  padding: 14px 16px; margin-bottom: 32px; box-shadow: var(--ombre);
}
.ri-somm-titre {
  font-weight: 800; font-size: .78rem; color: var(--vert-fonce);
  text-transform: uppercase; letter-spacing: .6px; margin-right: 6px;
}
.ri-somm a {
  font-size: .82rem; color: var(--texte); text-decoration: none;
  padding: 5px 12px; border-radius: 20px; background: var(--fond);
  transition: background .16s, color .16s;
}
.ri-somm a:hover { background: var(--vert); color: #fff; }
.ri-somm a b { color: var(--or); margin-right: 2px; }
.ri-somm a:hover b { color: var(--or-clair); }
html { scroll-behavior: smooth; }
@media (max-width: 576px) { .ri-somm a { font-size: .76rem; padding: 4px 10px; } }

/* =====================================================================
   FICHE DE PROGRESSION CORAN
   ===================================================================== */
.fiche-coran { max-width: 820px; margin: 0 auto; padding: 14px; }
.fc-page { background: #fff; border: 2px solid var(--vert); border-radius: 12px; padding: 26px 28px; color: #14201b; }

.fc-entete { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px;
             border-bottom: 2px solid var(--vert); padding-bottom: 14px; margin-bottom: 16px; }
.fc-rep { font-size: .68rem; color: var(--texte-doux); line-height: 1.55; flex: 1; }
.fc-ecole { flex: 2; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.fc-ecole strong { color: var(--vert); font-size: .95rem; text-transform: uppercase; line-height: 1.3; }
.fc-ecole span { font-size: .7rem; color: var(--texte-doux); }
.fc-annee { flex: 1; text-align: right; font-size: .7rem; color: var(--texte-doux); }
.fc-annee strong { font-size: .85rem; color: #14201b; }

.fc-titre { text-align: center; font-size: 1rem; font-weight: 800; letter-spacing: 1px;
            margin: 0 0 18px; color: var(--vert-nuit); }

.fc-identite { font-size: .82rem; margin-bottom: 14px !important; }
.fc-identite th { color: var(--texte-doux); font-weight: 600; width: 13%; padding: 5px 6px; border: none; }
.fc-identite td { padding: 5px 6px; border: none; width: 37%; }
.fc-identite tr { border-bottom: 1px solid #eef2f0; }

.fc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 18px; }
.fc-stat { background: #f2fbf6; border: 1px solid #d8ede3; border-radius: 10px; padding: 10px 6px; text-align: center; }
.fc-stat-or { background: #fdf6e6; border-color: #f0dfae; }
.fc-num { display: block; font-size: 1.5rem; font-weight: 800; color: var(--vert); line-height: 1.1; }
.fc-stat-or .fc-num { color: #b8860b; }
.fc-lib { font-size: .66rem; color: var(--texte-doux); text-transform: uppercase; letter-spacing: .3px; }

.fc-sous-titre { font-size: .78rem; font-weight: 800; color: var(--vert-fonce); text-transform: uppercase;
                 letter-spacing: .6px; margin: 0 0 8px; padding-left: 9px; border-left: 3px solid var(--or); }

.fc-table { font-size: .8rem; margin-bottom: 16px !important; }
.fc-table thead th { background: var(--vert); color: #fff; font-weight: 700; font-size: .7rem;
                     text-transform: uppercase; letter-spacing: .3px; padding: 7px 8px; border: none; }
.fc-table td { padding: 6px 8px; vertical-align: middle; }
.fc-table tbody tr { border-bottom: 1px solid #eef2f0; }
.fc-arabe { float: right; color: var(--vert); font-size: .95rem; }

.fc-statut { display: inline-block; padding: 2px 9px; border-radius: 12px; font-size: .66rem; font-weight: 700; }
.fc-valide   { background: #d9f2e4; color: #0a4f33; }
.fc-memorise { background: #dcf0e7; color: #0e6b45; }
.fc-revise   { background: #dbeaf8; color: #1c5a91; }
.fc-en_cours { background: #fdf0d5; color: #8a6410; }

.fc-synthese { background: var(--fond); border-radius: 10px; padding: 11px 14px; font-size: .8rem;
               display: flex; flex-direction: column; gap: 5px; margin-bottom: 20px; }

.fc-signatures { display: flex; justify-content: space-between; gap: 40px; font-size: .78rem; margin-top: 26px; }
.fc-signatures > div { flex: 1; text-align: center; }
.fc-ligne { display: block; border-top: 1px solid #999; margin-top: 6px; }
.fc-pied { text-align: right; font-size: .66rem; color: var(--texte-doux); margin: 14px 0 0; }

.saut-page { page-break-after: always; break-after: page; height: 26px; }

@media print {
  .fiche-coran { max-width: none; padding: 0; }
  .fc-page { border: 1.5px solid #000; border-radius: 0; padding: 14px 16px; page-break-inside: avoid; }
  .fc-stat { background: none !important; border: 1px solid #999; }
  .fc-table thead th { background: none !important; color: #000 !important; border-bottom: 1.5px solid #000; }
  .fc-statut { background: none !important; border: 1px solid #666; color: #000 !important; }
  .fc-synthese { background: none !important; border: 1px solid #ccc; }
}
@media (max-width: 576px) {
  .fc-stats { grid-template-columns: repeat(2, 1fr); }
  .fc-entete { flex-direction: column; text-align: center; }
  .fc-rep, .fc-annee { text-align: center; }
  .fc-identite th, .fc-identite td { display: block; width: auto; }
  .fc-signatures { flex-direction: column; gap: 24px; }
}

/* =====================================================================
   MATIÈRES & COEFFICIENTS
   ===================================================================== */
.mat-filiere {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; font-weight: 800; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .5px; color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
}
.mat-filiere i { font-size: 1rem; }
.mat-coran    { background: linear-gradient(135deg, #16916a, #0a4f33); }
.mat-arabe    { background: linear-gradient(135deg, #d9a12a, #a8760f); }
.mat-francais { background: linear-gradient(135deg, #3a8dde, #2456a0); }
.mat-compte {
  margin-left: auto; background: rgba(255,255,255,.22);
  padding: 2px 10px; border-radius: 12px; font-size: .78rem;
}
.mat-table th {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .3px;
  color: var(--texte-doux); font-weight: 700;
}
.mat-table td { padding: 9px 8px; }
.coef-input { font-weight: 800; font-variant-numeric: tabular-nums; max-width: 80px; margin: 0 auto; }
.coef-input:focus { border-color: var(--vert); box-shadow: 0 0 0 .18rem rgba(14,107,69,.15); }
.mat-sous {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--fond); border: 1px solid #e3eae6; border-radius: 14px;
  padding: 2px 9px; font-size: .74rem; color: var(--texte);
}
.mat-sous .sm-del { color: #c0392b; text-decoration: none; font-weight: 700; line-height: 1; opacity: .55; }
.mat-sous .sm-del:hover { opacity: 1; }
.btn-add-sm { font-size: .72rem; color: var(--vert); }

@media (max-width: 768px) {
  .mat-filiere { font-size: .74rem; padding: 10px 12px; }
  .mat-table td, .mat-table th { padding: 7px 6px; font-size: .82rem; }
  .coef-input { max-width: 62px; }
  .mat-sous { font-size: .68rem; }
}
