/* =========================================================================
   EduManageSSA — Socle CSS local (grille, composants, utilitaires)
   -------------------------------------------------------------------------
   Ce fichier remplace Bootstrap : il reprend uniquement les classes
   réellement utilisées par le logiciel, afin que l'interface s'affiche
   correctement MÊME SANS CONNEXION INTERNET (salle informatique, serveur
   local XAMPP/WAMP...). Il est chargé avant app.css, qui apporte ensuite
   l'identité visuelle (couleurs, ombres, bulletins).
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  color: #212529;
  font-size: 1rem;
  line-height: 1.5;
  font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}

a { color: #0d6e54; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

h1 { font-size: 2rem; font-weight: 600; margin: 0 0 .5rem; }
h2 { font-size: 1.7rem; font-weight: 600; margin: 0 0 .5rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin: 0 0 .5rem; }
h4 { font-size: 1.25rem; font-weight: 600; margin: 0 0 .5rem; }
h5 { font-size: 1.1rem; font-weight: 600; margin: 0 0 .5rem; }
h6 { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
hr { border: none; border-top: 1px solid #dee2e6; margin: 1rem 0; }
small, .small { font-size: .875em; }
code { font-family: Consolas, "Liberation Mono", monospace; font-size: .9em; }
dl, dd { margin: 0; }
dt { font-weight: 600; }

/* ---------- Conteneurs et grille ---------- */
.container-fluid { width: 100%; padding-left: 1.5rem; padding-right: 1.5rem; margin: 0 auto; }

.row { display: flex; flex-wrap: wrap; margin-left: -.75rem; margin-right: -.75rem; }
.row > * { padding-left: .75rem; padding-right: .75rem; width: 100%; }

.g-2 { margin: -.25rem; } .g-2 > * { padding: .25rem; }
.g-3 { margin: -.5rem; } .g-3 > * { padding: .5rem; }

.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

@media (min-width: 576px) {
  .col-sm-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
  .col-sm-7 { flex: 0 0 58.3333%; max-width: 58.3333%; }
}

@media (min-width: 768px) {
  .col-md-2 { flex: 0 0 16.6667%; max-width: 16.6667%; }
  .col-md-3 { flex: 0 0 25%; max-width: 25%; }
  .col-md-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-md-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
  .col-md-6 { flex: 0 0 50%; max-width: 50%; }
  .col-md-7 { flex: 0 0 58.3333%; max-width: 58.3333%; }
  .col-md-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}

@media (min-width: 992px) {
  .col-lg-3 { flex: 0 0 25%; max-width: 25%; }
  .col-lg-4 { flex: 0 0 33.3333%; max-width: 33.3333%; }
  .col-lg-5 { flex: 0 0 41.6667%; max-width: 41.6667%; }
  .col-lg-6 { flex: 0 0 50%; max-width: 50%; }
  .col-lg-7 { flex: 0 0 58.3333%; max-width: 58.3333%; }
  .col-lg-8 { flex: 0 0 66.6667%; max-width: 66.6667%; }
}

/* ---------- Utilitaires d'affichage ---------- */
.d-flex { display: flex; }
.d-block { display: block; }
.d-inline { display: inline; }
.d-inline-block { display: inline-block; }
.d-none { display: none !important; }
.flex-wrap { flex-wrap: wrap; }
.flex-column { flex-direction: column; }
.justify-content-between { justify-content: space-between; }
.justify-content-center { justify-content: center; }
.justify-content-end { justify-content: flex-end; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }
.align-items-start { align-items: flex-start; }
.align-middle { vertical-align: middle; }
.gap-1 { gap: .25rem; } .gap-2 { gap: .5rem; } .gap-3 { gap: 1rem; }
.h-100 { height: 100%; }
.w-100 { width: 100%; }
.position-relative { position: relative; }
.sticky-top { position: sticky; top: 0; z-index: 1020; }
.overflow-hidden { overflow: hidden; }

@media (min-width: 992px) {
  .align-items-lg-center { align-items: center; }
  .mb-lg-0 { margin-bottom: 0; }
}

/* ---------- Marges et espacements ---------- */
.m-0 { margin: 0; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: .25rem; } .mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: 1rem; } .mb-4 { margin-bottom: 1.5rem; } .mb-5 { margin-bottom: 3rem; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .25rem; } .mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: 1rem; } .mt-4 { margin-top: 1.5rem; } .mt-5 { margin-top: 3rem; }
.me-1 { margin-right: .25rem; } .me-2 { margin-right: .5rem; } .me-3 { margin-right: 1rem; }
.me-auto { margin-right: auto; }
.ms-1 { margin-left: .25rem; } .ms-2 { margin-left: .5rem; } .ms-3 { margin-left: 1rem; }
.ms-auto { margin-left: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }

.p-0 { padding: 0; } .p-1 { padding: .25rem; } .p-2 { padding: .5rem; }
.p-3 { padding: 1rem; } .p-4 { padding: 1.5rem; }
.px-2 { padding-left: .5rem; padding-right: .5rem; }
.px-3 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: .25rem; padding-bottom: .25rem; }
.py-2 { padding-top: .5rem; padding-bottom: .5rem; }
.py-3 { padding-top: 1rem; padding-bottom: 1rem; }
.py-4 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-5 { padding-top: 3rem; padding-bottom: 3rem; }
.ps-3 { padding-left: 1rem; }
.pt-3 { padding-top: 1rem; }

@media (min-width: 768px) {
  .px-md-4 { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (min-width: 992px) {
  .me-lg-2 { margin-right: .5rem; }
  .mb-lg-0 { margin-bottom: 0; }
}

/* ---------- Texte ---------- */
.text-center { text-align: center; }
.text-start { text-align: left; }
.text-end { text-align: right; }
.text-muted { color: #6c757d; }
.text-danger { color: #c94444; }
.text-success { color: #157347; }
.text-warning { color: #a8701c; }
.text-primary { color: #0d6e54; }
.text-dark { color: #212529; }
.text-white { color: #fff; }
.text-nowrap { white-space: nowrap; }
.text-uppercase { text-transform: uppercase; }
.fw-bold { font-weight: 700; }
.fw-semibold { font-weight: 600; }
.fw-normal { font-weight: 400; }
.fst-italic { font-style: italic; }
.fs-5 { font-size: 1.25rem; }
.fs-6 { font-size: 1.1rem; }
.lh-1 { line-height: 1; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  vertical-align: middle;
  border: 1px solid transparent;
  padding: .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: .375rem;
  cursor: pointer;
  background: #fff;
  color: #212529;
  text-decoration: none;
}

.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn:disabled, .btn.disabled { opacity: .6; cursor: not-allowed; }
.btn-sm { padding: .25rem .5rem; font-size: .875rem; border-radius: .25rem; }
.btn-lg { padding: .5rem 1rem; font-size: 1.15rem; }

.btn-primary { background: #0d6e54; border-color: #0d6e54; color: #fff; }
.btn-secondary { background: #6c757d; border-color: #6c757d; color: #fff; }
.btn-success { background: #157347; border-color: #157347; color: #fff; }
.btn-danger { background: #c94444; border-color: #c94444; color: #fff; }
.btn-warning { background: #d99a2b; border-color: #d99a2b; color: #3a2a00; }
.btn-light { background: #f8f9fa; border-color: #dee2e6; color: #212529; }

.btn-outline-primary { border-color: #0d6e54; color: #0d6e54; background: #fff; }
.btn-outline-primary:hover { background: #0d6e54; color: #fff; }
.btn-outline-secondary { border-color: #adb5bd; color: #5a6268; background: #fff; }
.btn-outline-secondary:hover { background: #6c757d; color: #fff; }
.btn-outline-danger { border-color: #c94444; color: #c94444; background: #fff; }
.btn-outline-danger:hover { background: #c94444; color: #fff; }
.btn-outline-success { border-color: #157347; color: #157347; background: #fff; }
.btn-outline-success:hover { background: #157347; color: #fff; }
.btn-outline-warning { border-color: #d99a2b; color: #8a6416; background: #fff; }
.btn-outline-warning:hover { background: #d99a2b; color: #3a2a00; }
.btn-outline-info { border-color: #2a94bd; color: #2a94bd; background: #fff; }
.btn-outline-info:hover { background: #2a94bd; color: #fff; }

.btn-close {
  border: none;
  background: transparent;
  font-size: 1.1rem;
  line-height: 1;
  padding: .25rem .4rem;
  cursor: pointer;
  color: inherit;
  opacity: .6;
  float: right;
}
.btn-close::before { content: "\2715"; }
.btn-close:hover { opacity: 1; }

/* ---------- Cartes ---------- */
.card {
  position: relative;
  border: 1px solid #eef0ef;
  border-radius: .75rem;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .06);
}

.card-header {
  background: #fff;
  border-bottom: 1px solid #eef0ef;
  border-radius: .75rem .75rem 0 0;
  font-weight: 600;
  padding: .75rem 1rem;
}

.card-body { padding: 1rem; }
.card-footer { padding: .75rem 1rem; border-top: 1px solid #eef0ef; }

/* ---------- Tableaux ---------- */
.table { width: 100%; border-collapse: collapse; margin-bottom: 0; background: transparent; }
.table th, .table td { padding: .6rem; border-top: 1px solid #dee2e6; text-align: left; vertical-align: middle; }
.table thead th { border-bottom: 2px solid #dee2e6; border-top: none; }
.table-light, .table-light > th, .table-light > td { background-color: #f8f9fa; }
.table-hover tbody tr:hover { background-color: rgba(0, 0, 0, .03); }
.table-sm th, .table-sm td { padding: .35rem .5rem; }
.table-bordered th, .table-bordered td { border: 1px solid #dee2e6; }
.table-responsive { width: 100%; overflow-x: auto; }
.table-notes input { max-width: 110px; }

/* ---------- Formulaires ---------- */
.form-label { display: block; margin-bottom: .3rem; font-weight: 500; }
.form-text { font-size: .85em; color: #6c757d; margin-top: .25rem; }

.form-control, .form-select {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: #212529;
  border: 1px solid #ced4da;
  border-radius: .375rem;
  background-color: #fff;
  font-family: inherit;
}

.form-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #6c757d 50%), linear-gradient(135deg, #6c757d 50%, transparent 50%);
  background-position: calc(100% - 15px) center, calc(100% - 10px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2rem;
}

.form-control:focus, .form-select:focus { outline: none; border-color: #0d6e54; }
.form-control-sm, .form-select-sm { padding: .25rem .5rem; font-size: .875rem; }
.form-control[type="file"] { padding: .3rem .5rem; }

.form-check { display: flex; align-items: center; gap: .45rem; margin-bottom: .3rem; }
.form-check-input { width: 1rem; height: 1rem; margin: 0; }
.form-check-label { margin: 0; }

.input-group { display: flex; width: 100%; }
.input-group-text {
  display: flex;
  align-items: center;
  padding: .375rem .75rem;
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-right: none;
  border-radius: .375rem 0 0 .375rem;
  white-space: nowrap;
}
.input-group > .form-control, .input-group > .form-select { border-radius: 0 .375rem .375rem 0; }

/* ---------- Badges, alertes, barres de progression ---------- */
.badge {
  display: inline-block;
  padding: .35em .65em;
  font-size: .75em;
  font-weight: 700;
  line-height: 1;
  border-radius: .375rem;
  color: #fff;
  background: #6c757d;
  white-space: nowrap;
}

.bg-primary { background-color: #0d6e54 !important; }
.bg-success { background-color: #157347 !important; }
.bg-danger { background-color: #c94444 !important; }
.bg-secondary { background-color: #6c757d !important; }
.bg-warning { background-color: #d99a2b !important; color: #3a2a00 !important; }
.bg-info { background-color: #2a94bd !important; }
.bg-light { background-color: #f8f9fa !important; color: #212529 !important; }
.bg-white { background-color: #fff !important; }

.alert {
  position: relative;
  padding: .8rem 1rem;
  border-radius: .5rem;
  margin-bottom: 1rem;
  border: 1px solid transparent;
}

.alert-danger { background: #f8d7da; border-color: #f1aeb5; color: #842029; }
.alert-success { background: #d1e7dd; border-color: #a3cfbb; color: #0f5132; }
.alert-info { background: #cfe2ff; border-color: #9ec5fe; color: #084298; }
.alert-warning { background: #fff3cd; border-color: #ffe69c; color: #664d03; }
.alert-dismissible { padding-right: 2.5rem; }
.alert-dismissible .btn-close { position: absolute; top: .5rem; right: .5rem; float: none; }

.progress { height: 1rem; background: #e9ecef; border-radius: .375rem; overflow: hidden; }
.progress-bar { height: 100%; background: #157347; color: #fff; text-align: center; font-size: .75rem; line-height: 1rem; }

/* ---------- Barre de navigation ---------- */
.navbar { position: relative; padding: .6rem 0; }
.navbar .container-fluid { display: flex; flex-wrap: wrap; align-items: center; }
.navbar-brand { display: inline-flex; align-items: center; font-size: 1.1rem; font-weight: 600; color: inherit; margin-right: 1rem; }
.navbar-dark .navbar-brand, .navbar-dark .nav-link { color: #fff; }
.navbar-brand:hover { text-decoration: none; }

.navbar-nav { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-item { margin: 0; }
.nav-link { display: block; padding: .5rem .8rem; color: inherit; }
.nav-link:hover { text-decoration: none; }

.navbar-collapse { display: flex; flex-basis: 100%; flex-grow: 1; align-items: center; }
.navbar-toggler {
  display: none;
  padding: .3rem .6rem;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .4);
  border-radius: .375rem;
  cursor: pointer;
  margin-left: auto;
}
.navbar-toggler-icon { display: block; width: 1.3rem; height: 2px; background: #fff; box-shadow: 0 6px 0 #fff, 0 -6px 0 #fff; }

@media (min-width: 992px) {
  .navbar-expand-lg .navbar-collapse { display: flex !important; flex-basis: auto; }
  .navbar-expand-lg .navbar-nav { flex-direction: row; }
}

@media (max-width: 991.98px) {
  .navbar-expand-lg .navbar-toggler { display: block; }
  .navbar-expand-lg .navbar-collapse { display: none; flex-direction: column; align-items: stretch; }
  .navbar-expand-lg .navbar-collapse.show { display: flex; }
  .navbar-expand-lg .navbar-nav { flex-direction: column; align-items: stretch; width: 100%; }
}

/* ---------- Menus déroulants ---------- */
.dropdown { position: relative; }
.dropdown-toggle::after {
  content: "";
  display: inline-block;
  margin-left: .35em;
  vertical-align: .15em;
  border-top: .3em solid;
  border-right: .3em solid transparent;
  border-left: .3em solid transparent;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 1030;
  min-width: 10rem;
  background: #fff;
  border: 1px solid #dee2e6;
  border-radius: .5rem;
  padding: .3rem;
  margin-top: .25rem;
  list-style: none;
  box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15);
}

.dropdown-menu.show { display: block; }
.dropdown-menu-end { left: auto; right: 0; }
.dropdown-item { display: block; width: 100%; padding: .45rem .8rem; color: #212529; border-radius: .35rem; }
.dropdown-item:hover { background: #f1f3f2; text-decoration: none; }

/* ---------- Onglets ---------- */
.nav-tabs { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 1rem; padding: 0; border-bottom: 1px solid #dee2e6; }
.nav-tabs .nav-link { border: 1px solid transparent; border-bottom: none; border-radius: .375rem .375rem 0 0; cursor: pointer; background: transparent; }
.nav-tabs .nav-link.active { border-color: #dee2e6 #dee2e6 #fff; background: #fff; font-weight: 600; }
.tab-pane { display: none; }
.tab-pane.active, .tab-pane.show.active { display: block; }

/* ---------- Divers ---------- */
.border { border: 1px solid #dee2e6; }
.border-bottom { border-bottom: 1px solid #dee2e6; }
.border-top { border-top: 1px solid #dee2e6; }
.border-success { border: 2px solid #157347 !important; }
.rounded { border-radius: .375rem; }
.shadow-sm { box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075); }
.shadow { box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .15); }
.shadow-lg { box-shadow: 0 1rem 3rem rgba(0, 0, 0, .175); }
.fade { opacity: 1; }
.collapse:not(.show) { display: none; }

/* Filtre de recherche des listes (remplace DataTables, sans dépendance) */
.table-filtre {
  display: flex;
  justify-content: flex-end;
  margin-bottom: .6rem;
}
.table-filtre input {
  max-width: 280px;
  padding: .35rem .7rem;
  border: 1px solid #ced4da;
  border-radius: .375rem;
  font-size: .9rem;
}
.table-filtre-vide { padding: .8rem; text-align: center; color: #6c757d; font-size: .9rem; }

/* Repli lorsque la police d'icônes Bootstrap Icons n'est pas disponible
   (installation sans Internet) : les icônes sont purement décoratives et
   ne doivent pas casser la mise en page. */
.bi { display: inline-block; font-style: normal; }
