/* ---------- RESET & BASE ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
  background: #f3f6f9;
  min-height: 100vh;
  height: 100%;
}

/* ---------- LOGIN PAGE ---------- */
.login-page {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: #edf1f6;
  padding: 1.5rem;
  width: 100%;
  max-width: 100%;
}

.login-box {
  background: #ffffff;
  padding: 2.5rem 2rem 2rem;
  border-radius: 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
  border: 1px solid #e2e8ef;
}

.login-box h1 {
  font-size: 1.7rem;
  font-weight: 600;
  color: #0f1e2e;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.2rem;
}

.login-box h1 i {
  color: #1486c4;
}

.login-box .sub {
  color: #6b7b93;
  font-size: 0.9rem;
  margin-bottom: 1.8rem;
  border-left: 3px solid #1486c4;
  padding-left: 12px;
}

.login-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #22384f;
  margin: 1.2rem 0 0.4rem 0.2rem;
}

.login-box input {
  width: 100%;
  padding: 0.7rem 1rem;
  border: 1.5px solid #d6e0e9;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #f9fbfd;
  transition: 0.15s;
}

.login-box input:focus {
  border-color: #1486c4;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.12);
}

.login-btn {
  width: 100%;
  margin-top: 2rem;
  padding: 0.75rem;
  background: #1486c4;
  border: none;
  border-radius: 40px;
  font-weight: 600;
  color: white;
  font-size: 1rem;
  cursor: pointer;
  transition: 0.15s;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.login-btn:hover {
  background: #0f6da3;
}

.login-btn:active {
  transform: scale(0.97);
}

.login-box .hint {
  margin-top: 1.2rem;
  font-size: 0.75rem;
  color: #8a9bb0;
  text-align: center;
}

.login-box .hint a {
  color: #1486c4;
  text-decoration: none;
  font-weight: 600;
}

.login-box .hint a:hover {
  text-decoration: underline;
}

/* ========== ADMIN LAYOUT ========== */
#adminWrap {
  display: none;
  flex-direction: column;
  min-height: 100vh;
  height: 100vh;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

/* ========== HEADER FIXE ========== */
.topbar {
  background: #ffffff;
  padding: 0.6rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e2e8ef;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  flex-shrink: 0;
  z-index: 50;
}

.topbar.fixed-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hamburger-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #22384f;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: 0.15s;
}

.hamburger-btn:hover {
  background: #eef3f8;
}

.topbar .brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: #0f1e2e;
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar .brand i {
  color: #1486c4;
}

.topbar .user {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 0.9rem;
  color: #22384f;
}

.topbar .user i {
  font-size: 1.2rem;
  color: #4e6278;
  cursor: pointer;
  transition: 0.15s;
  padding: 6px;
  border-radius: 30px;
}

.topbar .user a {
  color: #4e6278;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar .user i:hover {
  background: #eef3f8;
  color: #1486c4;
}

/* ========== BODY ========== */
.admin-body {
  display: flex;
  flex: 1;
  flex-direction: row;
  position: relative;
  width: 100%;
  max-width: 100%;
  height: calc(100vh - 60px);
  overflow: hidden;
}

/* ========== OVERLAY ========== */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ========== SIDEBAR FIXE ========== */
.sidebar {
  background: #ffffff;
  width: 260px;
  border-right: 1px solid #e2e8ef;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.25s ease, transform 0.3s ease;
  overflow: hidden;
  z-index: 100;
  height: 100%;
}

.sidebar.fixed-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
}

/* Sidebar réduit (bureau) */
.sidebar.collapsed {
  width: 70px;
}

.sidebar.collapsed .menu-text,
.sidebar.collapsed .submenu-arrow,
.sidebar.collapsed .menu-label,
.sidebar.collapsed .version,
.sidebar.collapsed .submenu {
  display: none;
}

.sidebar.collapsed .menu-link {
  justify-content: center;
  padding: 0.6rem 0;
}

.sidebar.collapsed .menu-link i {
  margin: 0;
  font-size: 1.2rem;
}

/* Bouton fermeture mobile (caché par défaut) */
.sidebar-close-mobile {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: #4e6278;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: 0.15s;
}

.sidebar-close-mobile:hover {
  background: #eef3f8;
  color: #0f1e2e;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem 1.2rem 0.8rem 1.2rem;
  border-bottom: 1px solid #eef3f8;
  flex-shrink: 0;
}

.sidebar-header .menu-label {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #8a9bae;
  font-weight: 600;
}

.sidebar-toggle {
  background: none;
  border: none;
  color: #8a9bae;
  cursor: pointer;
  font-size: 0.9rem;
  padding: 4px 8px;
  border-radius: 8px;
  transition: 0.15s;
}

.sidebar-toggle:hover {
  background: #eef3f8;
  color: #1486c4;
}

.sidebar.collapsed .sidebar-toggle i {
  transform: rotate(180deg);
}

/* Menu principal - scrollable */
.sidebar-menu {
  list-style: none;
  padding: 0.8rem 0.8rem;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-menu::-webkit-scrollbar {
  width: 4px;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: #eef3f8;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: #c5d2de;
  border-radius: 4px;
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: #a6b6c6;
}

.menu-item {
  margin-bottom: 2px;
}

.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  color: #33495f;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
}

.menu-link i {
  width: 20px;
  text-align: center;
  font-size: 1rem;
  color: #5e7288;
  flex-shrink: 0;
}

.menu-link .menu-text {
  flex: 1;
  white-space: nowrap;
}

.menu-link .submenu-arrow {
  font-size: 0.7rem;
  color: #8a9bae;
  transition: transform 0.25s ease;
  margin-left: auto;
}

.menu-link:hover {
  background: #eef3f8;
  color: #0f1e2e;
}

.menu-item.active > .menu-link {
  background: #e7f2fb;
  color: #0f1e2e;
  font-weight: 600;
}

.menu-item.active > .menu-link i {
  color: #1486c4;
}

/* Sous-menus */
.has-submenu .submenu {
  list-style: none;
  padding: 0;
  margin: 2px 0 4px 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 0;
}

.has-submenu.open .submenu {
  max-height: 400px;
  opacity: 1;
}

.has-submenu.open .submenu-arrow {
  transform: rotate(180deg);
}

.submenu li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.45rem 1rem 0.45rem 3.2rem;
  color: #4d607a;
  text-decoration: none;
  font-size: 0.85rem;
  border-radius: 8px;
  transition: 0.1s;
}

.submenu li a i {
  width: 18px;
  font-size: 0.8rem;
  color: #64798f;
}

.submenu li a:hover {
  background: #f4f8fb;
  color: #0f1e2e;
}

.submenu li a.active {
  background: #e7f2fb;
  color: #1486c4;
  font-weight: 600;
}

.submenu li a.active i {
  color: #1486c4;
}

/* Pied du sidebar */
.sidebar-footer {
  padding: 1rem 1.2rem;
  border-top: 1px solid #eef3f8;
  font-size: 0.7rem;
  color: #8a9bae;
  flex-shrink: 0;
}

/* ========== MAIN CONTENT (scrollable) ========== */
.main-content {
  flex: 1;
  padding: 1rem 2rem 2rem;
  background: #f3f6f9;
  width: 100%;
  max-width: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  height: 100%;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: #edf1f6;
}

.main-content::-webkit-scrollbar-thumb {
  background: #c5d2de;
  border-radius: 4px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: #a6b6c6;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1.6rem;
  width: 100%;
  max-width: 100%;
}

.page-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: #0f1e2e;
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-header h2 i {
  color: #1486c4;
}

.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn {
  padding: 0.4rem 1.2rem;
  border: 1px solid #d6e0e9;
  border-radius: 30px;
  background: white;
  font-weight: 500;
  font-size: 0.85rem;
  color: #22384f;
  cursor: pointer;
  transition: 0.1s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  text-decoration: none;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.btn-primary {
  background: #1486c4;
  border-color: #1486c4;
  color: white;
}

.btn-primary:hover {
  background: #0f6da3;
  border-color: #0f6da3;
  color: white;
}

.btn-white {
  background: #fff;
  border-color: #d6e0e9;
  color: #1486c4;
  font-weight: 600;
}

.btn-white:hover {
  background: #f5f7fa;
  border-color: #c8d0da;
  color: #0f6da3;
}

.btn-outline {
  background: transparent;
  border-color: #d6e0e9;
}

.btn-outline:hover {
  background: #eef3f8;
}

.btn-danger {
  background: #c8282d;
  border-color: #c8282d;
  color: white;
}

.btn-danger:hover {
  background: #c8282d;
  border-color: #c8282d;
  color: white;
}

.btn-success {
  background: #2e9e5b;
  border-color: #2e9e5b;
  color: white;
}

.btn-success:hover {
  background: #238247;
  border-color: #238247;
  color: white;
}

.btn-info {
  background: #1486c4;
  border-color: #1486c4;
  color: white;
}

.btn-info:hover {
  background: #0f6da3;
  border-color: #0f6da3;
  color: white;
}

.btn-warning {
  background: #d97706;
  border-color: #d97706;
  color: white;
}

.btn-warning:hover {
  background: #b45309;
  border-color: #b45309;
  color: white;
}

.btn-default {
  background: #64798f;
  border-color: #64798f;
  color: white;
}

.btn-default:hover {
  background: #4e6278;
  border-color: #4e6278;
  color: white;
}

.btn-active {
  background: #ffffff;
  border-color: #0f6da3;
  color: #0f6da3;
  font-weight: 700;
}

.btn-active:hover {
  background: #e7f2fb;
  border-color: #0f6da3;
  color: #0f6da3;
}

.btn-sm {
  padding: 0.25rem 0.9rem;
  font-size: 0.78rem;
}

/* Uniformite des boutons des barres d'outils (largeurs egales)
   + marge pour eviter le collage quand les boutons passent a la ligne */
.content > div:has(> b ~ a.btn) a.btn,
.content > div:has(> a.btn:first-child) a.btn {
  min-width: 104px;
  justify-content: center;
  vertical-align: middle;
  margin: 4px 6px 4px 0;
}

/* Boutons d'action dans les tableaux : largeur uniforme + marge anti-collage */
td a.btn,
.actions a.btn {
  min-width: 68px;
  justify-content: center;
  vertical-align: middle;
  margin: 3px 3px 3px 0;
}

/* Bouton aligne a droite (ex. « Imprimer les non payes ») */
.btn-toolbar-right {
  float: right;
  margin-left: 10px;
}

/* Garde l'alignement a droite du bouton flottant malgre les marges de la barre d'outils */
.content > div:has(> b ~ a.btn) a.btn.btn-toolbar-right,
.content > div:has(> a.btn:first-child) a.btn.btn-toolbar-right {
  float: right;
  margin: 4px 0 4px 10px;
}

/* Espace entre l'en-tete (titre <b> + boutons) et la table qui le suit */
.content > div:has(> b ~ a.btn) {
  margin-bottom: 16px;
}

/* Titre de page : design elegante (remplace « TITRE - ») */
.page-title {
  display: inline-block;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: #0f1e2e;
  margin-right: 14px;
  vertical-align: middle;
}
.page-title::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 24px;
  margin-left: 14px;
  border-radius: 4px;
  vertical-align: -4px;
  background: linear-gradient(180deg, #1486c4 0%, #79b9dd 100%);
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.10);
}

/* Selecteur d'annee academique (annee de travail) */
.annee-select-form {
  display: inline-block;
  margin-left: 14px;
  vertical-align: middle;
}
.annee-select {
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1486c4;
  background: #fff;
  border: 1px solid #d8e0ec;
  border-radius: 20px;
  padding: 0.35rem 1rem;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.annee-select:hover,
.annee-select:focus {
  border-color: #1486c4;
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.12);
}

.classes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.classes-head .annee-select-form {
  margin-left: 0;
}
.classes-filters {
  margin-bottom: 16px;
}
.classes-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.classes-row + .classes-row {
  margin-top: 8px;
}
.classes-row a.btn {
  margin: 0;
}
.classe-btn {
  width: 150px;
  justify-content: center;
  text-align: center;
}
.mention-btn {
  background: #102a43;
  border-color: #0b2239;
  color: #fff;
}
.mention-btn:hover {
  background: #0b2239;
  border-color: #0b2239;
  color: #fff;
}
.classes-row-actions {
  margin-top: 10px;
}

/* alerts */
.alert {
  padding: 0.7rem 1.2rem;
  border-radius: 16px;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  background: white;
  border: 1px solid #e2e8ef;
  font-size: 0.9rem;
  color: #0f1e2e;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  word-wrap: break-word;
}

.alert i {
  font-size: 1.1rem;
  color: #1486c4;
  flex-shrink: 0;
}

.alert-success {
  background: #eaf6ee;
  border-color: #cfe8da;
  color: #1c6b3c;
}

.alert-success i {
  color: #2e9e5b;
}

.alert-error {
  background: #fdecee;
  border-color: #f6ced3;
  color: #c8282d;
}

.alert-error i {
  color: #c8282d;
}

.alert-warning i {
  color: #c8282d;
}

/* Compat comptes glyphicon -> Font Awesome */
i.glyphicon {
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-style: normal;
  -webkit-font-smoothing: antialiased;
}

i.glyphicon-ok-sign::before {
  content: "\f058";
}

i.glyphicon-print::before {
  content: "\f02f";
}

/* ========== TABLES ========== */
.table-wrap,
.table-container {
  background: white;
  border-radius: 20px;
  padding: 0.2rem;
  border: 1px solid #e2e8ef;
  overflow-x: auto;
  margin-bottom: 1.8rem;
  width: 100%;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 480px;
}

.content > table {
  background: white;
  border-radius: 20px;
  border: 1px solid #e2e8ef;
  overflow: hidden;
  margin-bottom: 1.8rem;
}

/* Tableaux façon Bootstrap : conteneur avec scroll horizontal (table-responsive) */
.table-responsive {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  border: 1px solid #e2e8ef;
  border-radius: 20px;
  margin-bottom: 1.8rem;
}

.table-responsive table {
  margin: 0;
  border: none;
}

th {
  text-align: left;
  padding: 0.9rem 1rem 0.7rem 1rem;
  color: #22384f;
  font-weight: 600;
  border-bottom: 2px solid #edf1f6;
  background: #f9fbfd;
}

td {
  padding: 0.8rem 1rem;
  border-bottom: 1px solid #eef3f8;
  color: #1f2a3f;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:nth-child(even) {
  background: #f9fbfd;
}

tbody tr {
  transition: background 0.15s ease;
}

tbody tr:hover {
  background: #e9f4fc;
}

.badge {
  background: #e7f2fb;
  color: #0f1e2e;
  padding: 0.2rem 0.9rem;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-block;
  white-space: nowrap;
}

.badge-blue {
  background: #1486c4;
  color: white;
}

.badge-red {
  background: #c8282d;
  color: white;
}

.actions i {
  margin: 0 4px;
  color: #64798f;
  cursor: pointer;
  font-size: 0.95rem;
  transition: 0.1s;
}

.actions i:hover {
  color: #1486c4;
}

.footer-note {
  margin-top: 0.8rem;
  font-size: 0.75rem;
  color: #8a9bae;
  text-align: center;
  width: 100%;
  padding-bottom: 0.5rem;
}

/* ========== MODALS ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(2px);
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 1rem;
}

.modal-overlay.show {
  display: flex;
}

.modal-box {
  background: white;
  max-width: 420px;
  width: 100%;
  padding: 2rem 1.8rem 1.6rem;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
  animation: fadeIn 0.15s ease;
}

.modal-box.modal-medium {
  max-width: 560px;
  padding: 2rem 2rem 1.8rem;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

.modal-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f1e2e;
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.modal-header .modal-close {
  font-size: 1.4rem;
  color: #8a9bae;
  cursor: pointer;
  transition: 0.15s;
  padding: 4px;
  border-radius: 30px;
}

.modal-header .modal-close:hover {
  background: #eef3f8;
  color: #0f1e2e;
}

.modal-box h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f1e2e;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 0.4rem;
}

.modal-box h3 i {
  color: #c8282d;
}

.modal-box p {
  color: #4a5d78;
  font-size: 0.95rem;
  margin: 0.8rem 0 1.6rem;
  line-height: 1.4;
}

/* ========== FORMULAIRES ========== */
.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: #22384f;
  margin-bottom: 0.3rem;
}

label {
  display: block;
  font-weight: 600;
  color: #22384f;
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
input[type="search"],
select,
textarea {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1.5px solid #d6e0e9;
  border-radius: 12px;
  font-size: 0.95rem;
  background: #f9fbfd;
  transition: 0.15s;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #1f2a3f;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
input[type="search"]:focus,
select:focus,
textarea:focus {
  border-color: #1486c4;
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(59, 110, 165, 0.12);
}

input[type="checkbox"] {
  width: auto;
}

.checkstudent {
  width: auto;
}

/* Toggle affichage mot de passe */
.password-wrapper {
  position: relative;
}

.password-wrapper input[type="password"],
.password-wrapper input[type="text"] {
  padding-right: 90px;
}

.password-wrapper .toggle-pass {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  cursor: pointer;
  color: #1486c4;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  line-height: 1;
  text-decoration: none;
}

.password-wrapper .toggle-pass:hover {
  color: #0f6da3;
}

/* ========== CONTENU / CARTES ========== */
.content {
  width: 100%;
  max-width: 100%;
}

.content-full {
  width: 100%;
  max-width: 100%;
}

.card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid #e2e8ef;
  padding: 1.6rem 1.8rem;
  margin-bottom: 1.8rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #0f1e2e;
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid #edf1f6;
}

.connection-form {
  max-width: 520px;
  margin: 0 auto;
  padding: 6vh 1rem 2rem;
}

.connection-form .card {
  max-width: 460px;
  margin: 0 auto;
  text-align: center;
}

.txt-center {
  text-align: center;
}

.studentitem:hover {
  background-color: #e7f2fb;
  color: #0f1e2e;
  cursor: pointer;
}

/* ---------- FICHE ETUDIANT ---------- */
.student-thumb {
  width: 38px;
  height: 50px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8ef;
  background: #eef3f8;
  display: inline-block;
  vertical-align: middle;
}

.student-thumb-empty {
  display: inline-flex;
  width: 38px;
  height: 50px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px dashed #c5d2de;
  background: #f9fbfd;
  color: #8a9bae;
  font-size: 0.9rem;
}
.fiche-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.9rem 1.2rem;
}

.fiche-grid-one {
  grid-template-columns: 1fr;
  gap: 0.45rem;
}

.fiche-line {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.fiche-line .fiche-label {
  min-width: 150px;
  text-align: left;
  flex-shrink: 0;
}

.fiche-sep {
  color: #8a9bae;
}

.fiche-line .fiche-value {
  text-align: left;
}

.fiche-cols {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex: 1;
  min-width: 0;
}

.fiche-cols .fiche-grid-one {
  flex: 1;
  min-width: 0;
}

.fiche-side {
  flex-shrink: 0;
  min-width: 200px;
  border: 1px solid #e5ebf3;
  border-radius: 8px;
  padding: 0.9rem;
}

.fiche-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.fiche-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: #8a9bae;
  font-weight: 600;
}

.fiche-value {
  font-size: 0.95rem;
  color: #0f1e2e;
  font-weight: 500;
  word-break: break-word;
}

.fiche-id-card {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  flex-wrap: wrap;
}

.fiche-photo {
  width: 110px;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid #e2e8ef;
  background: #eef3f8;
}

.fiche-photo-placeholder {
  width: 110px;
  height: 140px;
  border-radius: 14px;
  border: 1px dashed #c5d2de;
  background: #f9fbfd;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8a9bae;
  font-size: 0.8rem;
  text-align: center;
}

.new-photo-img {
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fiche-section h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1486c4;
  margin-bottom: 0.9rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #edf1f6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fiche-section h3.small i {
  font-size: 0.9rem;
}

.fiche-section h3 i.glyphicon {
  font-size: 1rem;
}

.fiche-diplome {
  border: 1px solid #edf1f6;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  margin-bottom: 0.7rem;
  background: #f9fbfd;
}

.fiche-diplome .fiche-diplome-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.fiche-diplome .fiche-diplome-head small {
  color: #8a9bae;
}

.dip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 8px;
  border: 1px solid #edf1f6;
  padding: 10px;
  border-radius: 12px;
  background: #f9fbfd;
}

.dip-row .form-group {
  flex: 1;
  min-width: 130px;
  margin-bottom: 0;
}

/* ---------- RECADRAGE PHOTO ---------- */
.photo-card .fiche-section {
  height: 300px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.photo-card .fiche-section h3 {
  flex: 0 0 auto;
}

.photo-crop-panel {
  margin-top: 0;
  padding: 1rem;
  border: 1px solid #edf1f6;
  border-radius: 14px;
  background: #f9fbfd;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.photo-crop-header {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 0.5rem;
  flex: 0 0 auto;
}

.photo-crop-header small {
  color: #8a9bae;
}

.photo-crop-stage {
  flex: 1 1 auto;
  min-height: 50%;
  width: 100%;
  max-width: 100%;
  margin: 0;
  background: #0f1e2e;
  border-radius: 12px;
  overflow: hidden;
}

.photo-crop-stage img {
  max-width: 100%;
  display: block;
  margin: 0 auto;
}

.photo-crop-tools {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 5px;
  margin-top: 0.6rem;
  flex: 0 0 auto;
}

.photo-crop-tools .btn {
  padding: 3px 7px;
  font-size: 11px;
  white-space: nowrap;
}

/* ---------- PARCOURS SOUS MENTIONS ---------- */
.parcours-block td {
  background: #f6f9fd;
  padding: 0.35rem 1rem 0.6rem;
}

.parcours-sublist {
  width: 100%;
  border-collapse: collapse;
}

.parcours-sublist tr {
  border: none;
}

.parcours-sublist td {
  border: none;
  background: transparent;
  padding: 0.3rem 0;
  font-size: 0.9rem;
}

.parcours-sublist td i {
  color: #1486c4;
}

.parcours-sublist .classe-line td {
  padding-left: 1.7rem;
}

.parcours-sublist .classe-line td i {
  color: #7ea2c8;
}

.parcours-vide {
  color: #8a9bae;
}

/* ========== BADGE EMPRUNTS (sidebar) ========== */
#badge-emprunts {
  vertical-align: middle;
}

/* ---------- RESPONSIVE MOBILE ---------- */
@media (max-width: 820px) {
  .sidebar {
    width: 220px;
  }
  .main-content {
    padding: 1.2rem;
  }
}

@media (max-width: 768px) {
  /* Afficher le bouton hamburger */
  .hamburger-btn {
    display: block;
  }

  .sidebar-close-mobile {
    display: block;
  }

  #adminWrap {
    height: 100vh;
    overflow: hidden;
  }

  .admin-body {
    height: calc(100vh - 56px);
  }

  /* Sidebar coulissant depuis la gauche */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    min-height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 1px solid #e2e8ef;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.08);
    z-index: 100;
    overflow-y: auto;
    height: 100vh;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .sidebar.collapsed {
    width: 280px;
  }

  .sidebar.collapsed .menu-text,
  .sidebar.collapsed .submenu-arrow,
  .sidebar.collapsed .menu-label,
  .sidebar.collapsed .version,
  .sidebar.collapsed .submenu {
    display: flex;
  }

  .sidebar.collapsed .menu-link {
    justify-content: flex-start;
    padding: 0.6rem 1rem;
  }

  .sidebar.collapsed .menu-link i {
    margin: 0;
    font-size: 1rem;
  }

  /* Cacher le bouton toggle sur mobile */
  .sidebar-toggle {
    display: none;
  }

  .sidebar-header {
    padding: 1rem 1rem 0.8rem 1rem;
  }

  .sidebar-header .menu-label {
    font-size: 0.6rem;
  }

  /* Overlay */
  .sidebar-overlay.active {
    display: block;
  }

  /* Ajuster le main content */
  .main-content {
    padding: 1rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    height: calc(100vh - 56px);
  }

  .topbar {
    padding: 0.5rem 1rem;
    width: 100%;
    max-width: 100%;
    position: sticky;
    top: 0;
    z-index: 50;
  }

  .topbar .brand {
    font-size: 1.1rem;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    max-width: 100%;
  }

  .page-header h2 {
    font-size: 1.2rem;
  }

  .btn-group {
    width: 100%;
    justify-content: stretch;
  }

  .btn-group .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.78rem;
    padding: 0.4rem 0.5rem;
    white-space: nowrap;
  }

  .btn-group .btn i {
    margin-right: 4px;
  }

  .modal-box.modal-medium {
    padding: 1.5rem;
    max-width: 95%;
  }

  .modal-box {
    max-width: 95%;
    padding: 1.5rem;
  }

  .table-wrap,
  .table-container,
  .table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Tables directes / dans cartes : scroll horizontal sur mobile */
  .content > table,
  .card table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .content > div:has(> b ~ a.btn) a.btn,
  .content > div:has(> a.btn:first-child) a.btn {
    min-width: 92px;
  }

  td a.btn,
  .actions a.btn {
    min-width: 60px;
  }

  table {
    min-width: 460px;
    font-size: 0.82rem;
  }

  .content > table {
    border-radius: 12px;
  }

  th, td {
    padding: 0.6rem 0.8rem;
  }

  .alert {
    font-size: 0.82rem;
    padding: 0.6rem 1rem;
  }

  .alert i {
    font-size: 1rem;
  }

  .sidebar.fixed-sidebar {
    position: fixed;
    top: 0;
    height: 100vh;
  }
}

@media (max-width: 480px) {
  .login-box {
    padding: 1.8rem 1.2rem;
  }

  .sidebar {
    width: 260px;
  }

  .topbar .user span {
    display: none;
  }

  .topbar .user i {
    font-size: 1.1rem;
  }

  .topbar {
    padding: 0.4rem 0.8rem;
  }

  .table-wrap,
  .table-container {
    border-radius: 12px;
  }

  th,
  td {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
  }

  .actions i {
    font-size: 0.8rem;
    margin: 0 2px;
  }

  .badge {
    font-size: 0.6rem;
    padding: 0.15rem 0.6rem;
  }

  .alert {
    font-size: 0.75rem;
    padding: 0.5rem 0.8rem;
    gap: 8px;
  }

  .alert i {
    font-size: 0.9rem;
  }

  .modal-box {
    padding: 1.2rem 1rem 1rem;
  }

  .modal-box h3 {
    font-size: 1.1rem;
  }

  .form-group input,
  .form-group select {
    font-size: 0.9rem;
    padding: 0.5rem 0.8rem;
  }

  /* Boutons de validation des formulaires pleine largeur sur mobile */
  .card form button[type="submit"] {
    width: 100%;
    justify-content: center;
  }

  .modal-actions .btn {
    min-width: 70px;
    font-size: 0.8rem;
    padding: 0.3rem 0.8rem;
  }

  .page-header h2 {
    font-size: 1.1rem;
  }

  .btn-group .btn {
    font-size: 0.7rem;
    padding: 0.3rem 0.4rem;
  }

  .btn-group .btn i {
    font-size: 0.7rem;
    margin-right: 2px;
  }

  .main-content {
    padding: 0.8rem;
    height: calc(100vh - 50px);
  }

  .topbar {
    padding: 0.4rem 0.8rem;
  }

  .topbar .brand {
    font-size: 1rem;
  }

  .hamburger-btn {
    font-size: 1.2rem;
    padding: 2px 6px;
  }

  .sidebar-header .menu-label {
    font-size: 0.55rem;
  }

  .menu-link {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem;
  }

  .submenu li a {
    font-size: 0.78rem;
    padding: 0.35rem 0.8rem 0.35rem 2.5rem;
  }

  .modal-overlay {
    padding: 0.5rem;
  }

  #adminWrap {
    height: 100vh;
  }

  .admin-body {
    height: calc(100vh - 50px);
  }

  .card {
    padding: 1.2rem 1rem;
  }

  .connection-form {
    padding-top: 3vh;
  }
}

/* Correction pour les très petits écrans */
@media (max-width: 360px) {
  .btn-group {
    flex-direction: column;
    gap: 5px;
  }

  .btn-group .btn {
    width: 100%;
    justify-content: center;
  }

  .topbar .user {
    gap: 8px;
  }

  .sidebar {
    width: 220px;
  }

  th, td {
    padding: 0.4rem 0.4rem;
    font-size: 0.7rem;
  }

  table {
    min-width: 380px;
  }
}

/* ========== IMPRESSION FICHES (CV PAPIER) ========== */
.print-cv {
  display: none;
}

@media print {
  @page {
    size: A4 portrait;
    margin: 7mm 7mm 12mm;

    @bottom-center {
      content: "Page " counter(page) " / " counter(pages);
      font-family: "Inter", Arial, sans-serif;
      font-size: 8pt;
      color: #8a9bae;
      vertical-align: top;
      padding-top: 3mm;
    }
  }

  html,
  body {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
  }

  #adminWrap {
    display: block !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  .topbar,
  .sidebar,
  .sidebar-overlay,
  .sidebar-footer,
  .alert,
  .no-print {
    display: none !important;
  }

  .admin-body {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }

  .main-content {
    display: block !important;
    overflow: visible !important;
    height: auto !important;
    background: #ffffff !important;
    padding: 0 !important;
  }

  .content {
    display: none !important;
  }

  .print-cv {
    display: block !important;
  }

  .pcv-sheet {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 7mm 11mm;
    background: #ffffff;
    color: #1c2733;
    font-family: Georgia, "Times New Roman", Times, serif;
    font-size: 10pt;
    line-height: 1;
    box-sizing: border-box;
  }

  .pcv-brand {
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  .pcv-header {
    page-break-inside: avoid;
    page-break-after: avoid;
  }

  .pcv-kv,
  .pcv-line,
  .pcv-entry {
    page-break-inside: avoid;
  }

  .pcv-section h3 + * {
    page-break-before: avoid;
  }

  .pcv-foot {
    page-break-before: avoid;
  }

  .pcv-brand {
    text-align: center;
    padding-bottom: 1.5mm;
    border-bottom: 1.5px solid #c8282d;
    margin-bottom: 3mm;
    display: flex;
    align-items: center;
    gap: 6mm;
  }

  .pcv-brand-img {
    height: 20mm;
    flex-shrink: 0;
  }

  .pcv-brand-body {
    flex: 1;
  }

  .pcv-brand-annee {
    font-size: 8.5pt;
    color: #8a9bae;
    margin-top: 0.6mm;
    letter-spacing: 1px;
  }

  .pcv-brand-contact {
    font-size: 7pt;
    color: #8a9bae;
    text-align: left;
    flex-shrink: 0;
  }

  .pcv-brand-contact span {
    display: block;
    white-space: nowrap;
    line-height: 1.5;
  }

  .pcv-brand-left {
    flex-shrink: 0;
    text-align: center;
  }

  .pcv-brand-name {
    font-family: "Inter", Arial, sans-serif;
    font-size: 13pt;
    letter-spacing: 5px;
    color: #102a43;
    text-transform: uppercase;
    font-weight: 700;
  }

  .pcv-matricule-side {
    margin-left: auto;
    text-align: right;
    flex-shrink: 0;
  }

  .pcv-brand .pcv-brand-sub {
    font-family: "Inter", Arial, sans-serif;
    font-size: 7pt;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: #8a9bae;
    margin-top: 0.4mm;
  }

  .pcv-header {
    display: flex;
    gap: 5mm;
    align-items: flex-start;
    margin-bottom: 3mm;
    page-break-inside: avoid;
  }

  .pcv-photo {
    width: 23mm;
    height: 27mm;
    object-fit: cover;
    border: 1.2px solid #102a43;
    padding: 1px;
    background: #ffffff;
    flex-shrink: 0;
  }

  .pcv-photo-initials {
    width: 23mm;
    height: 27mm;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18pt;
    color: #102a43;
    background: #f4f8fb;
    border: 1.2px solid #102a43;
  }

  .pcv-name {
    font-size: 18pt;
    font-weight: 700;
    color: #102a43;
    margin: 0;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .pcv-firstname {
    font-size: 11pt;
    font-weight: 400;
    color: #1486c4;
    margin: 0 0 1.5mm;
    line-height: 1.1;
  }

  .pcv-titre {
    font-size: 9pt;
    color: #102a43;
    letter-spacing: 1px;
    font-style: normal;
    font-weight: 700;
    margin-bottom: 1.5mm;
  }

  .pcv-idline {
    font-family: "Inter", Arial, sans-serif;
    font-size: 8pt;
    color: #33495f;
  }

  .pcv-lbl {
    font-weight: 700;
    color: #102a43;
  }

  .pcv-section {
    margin-bottom: 6mm;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .pcv-bullet li,
  .pcv-entry {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  table tr,
  table thead {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  table thead {
    display: table-header-group;
  }

  .pcv-prof .pcv-section {
    margin-bottom: 3mm;
  }

  .pcv-ancien .pcv-section {
    margin-bottom: 3mm;
  }

  .pcv-ancien .pcv-section h3 {
    padding-top: 1mm;
  }

  .pcv-prof .pcv-section h3 {
    padding-top: 1mm;
  }

  .pcv-section h3 {
    font-family: "Inter", Arial, sans-serif;
    font-size: 9pt;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #102a43;
    margin: 0 0 2mm;
    padding-bottom: 1.2mm;
    padding-top: 2mm;
    border-bottom: 1px solid #e7b9bb;
    page-break-after: avoid;
    break-after: avoid;
  }

  .pcv-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 6mm;
    row-gap: 0.3mm;
  }

  .pcv-one {
    display: block;
  }

  .pcv-kv {
    display: flex;
    align-items: baseline;
    gap: 1mm;
    margin-bottom: 0.4mm;
  }

  .pcv-kv .pcv-lbl {
    min-width: 48mm;
    flex-shrink: 0;
    text-align: left;
  }

  .pcv-etat-cols {
    display: flex;
    gap: 8mm;
    align-items: flex-start;
  }

  .pcv-etat-cols .pcv-one {
    flex: 1;
    min-width: 0;
  }

  .pcv-side-box {
    flex-shrink: 0;
    width: 55mm;
    border: 0.8px solid #e7b9bb;
    border-radius: 2mm;
    padding: 2mm 3mm;
  }

  .pcv-side-box .pcv-lbl {
    min-width: 18mm;
  }

  .pcv-kv .pcv-colon {
    flex-shrink: 0;
  }

  .pcv-kv .pcv-val {
    text-align: left;
  }

  .pcv-entry {
    margin-bottom: 1mm;
    page-break-inside: avoid;
  }

  .pcv-entry-title {
    font-weight: 700;
  }

   .pcv-entry-meta {
     font-family: "Inter", Arial, sans-serif;
     font-size: 7.5pt;
     color: #c8282d;
     text-transform: uppercase;
     letter-spacing: 1px;
     margin-top: 3px;
   }

  .pcv-entry-sub {
    color: #33495f;
    font-size: 9pt;
  }

  .pcv-bullet {
    list-style: none;
    margin: 0 0 0 5mm;
    padding: 0;
  }

  .pcv-bullet li {
    position: relative;
    padding-left: 4.5mm;
    margin-bottom: 2mm;
    page-break-inside: avoid;
  }

  .pcv-bullet li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    top: 0;
    color: #c8282d;
    font-size: 11pt;
    line-height: 1;
  }

  .pcv-foot {
    margin-top: 3mm;
    padding-top: 1.5mm;
    border-top: 1px solid #e7b9bb;
    text-align: center;
    font-family: "Inter", Arial, sans-serif;
    font-size: 7pt;
    color: #8a9bae;
    letter-spacing: 1px;
  }
}
/* Badge compteur (mentions / classes) */
.mcnt { display:inline-block; margin-left:0.4rem; background:rgba(255,255,255,0.9); color:#0f6da3; border-radius:10px; padding:0 0.45rem; font-size:0.74rem; font-weight:700; line-height:1.5; }

.quick-edit-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1rem;
}
.quick-edit-grid .form-group {
  margin-bottom: 0.8rem;
}
@media (max-width: 600px) {
  .quick-edit-grid {
    grid-template-columns: 1fr;
  }
}

.inscrits-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.inscrits-count {
  display: inline-block;
  background: #e7f2fb;
  color: #0f6da3;
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 700;
}
.inscrits-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.inscrits-filters {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.inscrits-filters .form-group {
  margin-bottom: 0;
  min-width: 200px;
}
.inscrits-search-group {
  flex: 1 1 280px;
}
.inscrits-search-wrap {
  position: relative;
}
.inscrits-search-wrap i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #8a9bb0;
  font-size: 0.85rem;
  pointer-events: none;
}
.inscrits-search-wrap input {
  width: 100%;
  padding-left: 34px;
}
.inscrits-table {
  margin-top: 0;
}
.inscrits-table th {
  white-space: nowrap;
}
.inscrits-table td {
  vertical-align: middle;
}
.inscrits-table tbody tr:hover {
  background: #f6fafd;
}
.classe-badge {
  display: inline-block;
  background: #e7f2fb;
  color: #0f6da3;
  border-radius: 12px;
  padding: 2px 8px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.inscrits-actions .btn {
  min-width: auto;
}
@media (max-width: 700px) {
  .inscrits-toolbar,
  .inscrits-filters {
    align-items: stretch;
  }
  .inscrits-filters .form-group {
    min-width: 100%;
  }
}

.btn.btn-magic-edit {
  position: relative;
  width: 40px;
  min-width: 40px;
  height: 32px;
  padding: 0.25rem;
  justify-content: center;
  border-color: #6a45d8;
  background: linear-gradient(135deg, #7b4dff 0%, #1486c4 100%);
  color: #ffffff;
  box-shadow: 0 2px 7px rgba(123, 77, 255, 0.3);
}
.btn.btn-magic-edit:hover {
  color: #ffffff;
  filter: brightness(1.1);
}
.btn.btn-magic-edit::after {
  content: "✦";
  position: absolute;
  top: -5px;
  right: -2px;
  font-size: 9px;
  line-height: 1;
  color: #ffd166;
  text-shadow: 0 0 4px #ffffff;
  pointer-events: none;
}

.ecolage-student-photo {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 50%;
  border: 1px solid #e2e8ef;
  background: #eef3f8;
  flex: 0 0 40px;
}
.ecolage-student-photo-empty {
  display: inline-flex;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px dashed #c5d2de;
  background: #f9fbfd;
  color: #8a9bae;
  font-size: 0.9rem;
}

.student-thumb-sm {
  width: 28px;
  height: 36px;
  border-radius: 6px;
}
.student-thumb-empty-sm {
  width: 28px;
  height: 36px;
  border-radius: 6px;
  font-size: 0.75rem;
}

.inscrits-table {
  table-layout: fixed;
  width: 100%;
}
.inscrits-table col.col-check { width: 34px; }
.inscrits-table col.col-photo { width: 54px; }
.inscrits-table col.col-mat { width: 105px; }
.inscrits-table col.col-classe { width: 180px; }
.inscrits-table col.col-actions { width: 300px; }
.inscrits-table th:last-child,
.inscrits-table td:last-child {
  position: sticky;
  right: 0;
  z-index: 2;
  box-shadow: -8px 0 8px -8px rgba(30, 50, 80, 0.18);
}
.inscrits-table th:last-child {
  background: #f9fbfd;
}
.inscrits-table td:last-child {
  background: #ffffff;
}
.inscrits-table tbody tr:nth-child(even) td:last-child {
  background: #f9fbfd;
}
.inscrits-table tbody tr:hover td:last-child {
  background: #f6fafd;
}
.inscrits-table th.inscrits-th-classe { white-space: normal; line-height: 1.2; }
.inscrits-table .classe-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}
.inscrits-classe-meta {
  margin-top: 2px;
  font-size: 0.72rem;
  color: #6b7c93;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 1200px) {
  .inscrits-table col.col-check { width: 30px; }
  .inscrits-table col.col-photo { width: 52px; }
  .inscrits-table col.col-mat { width: 90px; }
  .inscrits-table col.col-classe { width: 150px; }
  .inscrits-table col.col-actions { width: 200px; }
  .inscrits-actions .action-label { display: none; }
  .inscrits-actions .btn { min-width: 32px; padding: 0.25rem 0.35rem; }
}

/* ============================================================
   UIM - CHARTE GRAPHIQUE (Universite Internationale de Madagascar)
   Palette : rouge #c8282d, bleu #1486c4, marine #0b2239 / #102a43,
   vert #5c8f1d (globe). Theme distinct de UIM.
   ============================================================ */
:root {
  --uim-red: #c8282d;
  --uim-red-dark: #a11d22;
  --uim-blue: #1486c4;
  --uim-blue-dark: #0f6da3;
  --uim-navy: #0b2239;
  --uim-navy-2: #102a43;
  --uim-navy-3: #123a5e;
  --uim-green: #5c8f1d;
  --uim-bg: #f3f6f9;
  --uim-line: #e2e8ef;
  --uim-text: #0f1e2e;
  --uim-muted: #6b7f95;
}

/* ---------- Barre superieure ---------- */
.topbar,
.topbar.fixed-header {
  background: linear-gradient(100deg, #0b2239 0%, #102a43 58%, #0f4c75 100%);
  border-bottom: 3px solid var(--uim-red);
  box-shadow: 0 4px 18px rgba(11, 34, 57, 0.2);
}

.topbar .brand {
  color: #ffffff;
  text-decoration: none;
  gap: 10px;
}

.topbar .brand:hover {
  color: #ffffff;
}

.topbar .brand-logo {
  height: 40px;
  width: auto;
  display: block;
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.3));
}

.topbar .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.topbar .brand-text b {
  font-size: 1.05rem;
  letter-spacing: 2.5px;
  color: #ffffff;
}

.topbar .brand-text small {
  font-size: 0.58rem;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: #b9d6ea;
  font-weight: 500;
}

.topbar .user {
  color: #dcecf8;
}

.topbar .user i,
.topbar .user a {
  color: #b9d6ea;
}

.topbar .user i:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

.hamburger-btn {
  color: #eaf5ff;
}

.hamburger-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- Sidebar marine ---------- */
.sidebar {
  background: linear-gradient(180deg, #0b2239 0%, #102a43 55%, #123a5e 100%);
  border-right: none;
  box-shadow: inset -1px 0 0 rgba(255, 255, 255, 0.05);
}

.sidebar-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.09);
}

.sidebar-header .menu-label {
  color: #8fb6d4;
}

.sidebar-toggle,
.sidebar-close-mobile {
  color: #9fc3dc;
}

.sidebar-toggle:hover,
.sidebar-close-mobile:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.sidebar-menu::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
}

.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.menu-link {
  color: #d5e6f3;
}

.menu-link i {
  color: #8fb6d4;
}

.menu-link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.menu-link:hover i {
  color: #ffffff;
}

.menu-link .submenu-arrow {
  color: #8fb6d4;
}

.menu-item.active > .menu-link {
  background: linear-gradient(90deg, rgba(200, 40, 45, 0.95), rgba(20, 134, 196, 0.45));
  color: #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.menu-item.active > .menu-link i {
  color: #ffffff;
}

.menu-item.active > .menu-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: #ffffff;
}

.submenu li a {
  color: #b6d0e2;
}

.submenu li a i {
  color: #8fb6d4;
}

.submenu li a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #ffffff;
}

.submenu li a.active {
  background: rgba(20, 134, 196, 0.28);
  color: #ffffff;
}

.submenu li a.active i {
  color: #ffffff;
}

.sidebar-footer {
  border-top: 1px solid rgba(255, 255, 255, 0.09);
  color: #8fb6d4;
  line-height: 1.4;
}

/* ---------- Contenu principal ---------- */
.main-content {
  background:
    radial-gradient(circle at 100% 0, rgba(20, 134, 196, 0.07), transparent 42%),
    radial-gradient(circle at 0 100%, rgba(200, 40, 45, 0.05), transparent 40%),
    var(--uim-bg);
}

.page-header h2 {
  color: var(--uim-text);
}

.page-header h2 i {
  color: var(--uim-red);
}

.page-title::after {
  background: linear-gradient(180deg, var(--uim-red) 0%, var(--uim-blue) 100%);
  box-shadow: 0 0 0 3px rgba(200, 40, 45, 0.1);
}

.card {
  border-radius: 16px;
  border: 1px solid var(--uim-line);
  box-shadow: 0 10px 26px rgba(11, 34, 57, 0.06);
}

.card h2 {
  padding-left: 14px;
  position: relative;
  border-bottom: 1px solid #edf1f6;
}

.card h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 12px;
  width: 4px;
  border-radius: 4px;
  background: linear-gradient(180deg, var(--uim-red), var(--uim-blue));
}

/* ---------- Boutons ---------- */
.btn {
  border-radius: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--uim-blue), var(--uim-blue-dark));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(20, 134, 196, 0.22);
}

.btn-primary:hover {
  background: linear-gradient(135deg, var(--uim-blue-dark), #0b5c8f);
  border-color: transparent;
}

.btn-danger {
  background: linear-gradient(135deg, var(--uim-red), var(--uim-red-dark));
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(200, 40, 45, 0.22);
}

.btn-danger:hover {
  background: linear-gradient(135deg, var(--uim-red-dark), #8a161a);
  border-color: transparent;
}

.btn-info {
  background: linear-gradient(135deg, var(--uim-blue), var(--uim-blue-dark));
  border-color: transparent;
}

.btn-info:hover {
  background: linear-gradient(135deg, var(--uim-blue-dark), #0b5c8f);
  border-color: transparent;
}

.btn-success {
  background: linear-gradient(135deg, #5c8f1d, #47700f);
  border-color: transparent;
}

.btn-success:hover {
  background: linear-gradient(135deg, #47700f, #355608);
  border-color: transparent;
}

.btn-white {
  color: var(--uim-blue-dark);
}

.btn-white:hover {
  color: var(--uim-red);
}

/* ---------- Tableaux ---------- */
.table-wrap,
.table-container,
.table-responsive,
.content > table {
  border-radius: 14px;
}

th {
  background: #eef4f9;
  color: var(--uim-navy-2);
  border-bottom: 2px solid #d9e6f2;
}

tbody tr:hover {
  background: #edf7fd;
}

/* ---------- Alertes / badges ---------- */
.alert {
  border-radius: 14px;
}

.badge {
  background: #e7f2fb;
  color: var(--uim-navy-2);
}

.badge-blue {
  background: var(--uim-blue);
}

.badge-red {
  background: var(--uim-red);
}

.alert-error {
  background: #fdeef0;
  border-color: #f6ced3;
  color: var(--uim-red-dark);
}

.alert-error i {
  color: var(--uim-red);
}

/* ---------- Page de connexion ---------- */
.login-page {
  background:
    radial-gradient(circle at 15% 18%, rgba(20, 134, 196, 0.32), transparent 42%),
    radial-gradient(circle at 85% 85%, rgba(200, 40, 45, 0.26), transparent 42%),
    linear-gradient(135deg, #0b2239 0%, #102a43 55%, #123a5e 100%);
}

.login-box {
  max-width: 400px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-top: 5px solid var(--uim-red);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.35);
}

.login-logo {
  text-align: center;
  margin-bottom: 1rem;
}

.login-logo img {
  width: 170px;
  max-width: 78%;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.12));
}

.login-box h1 {
  justify-content: center;
  text-align: center;
  font-size: 1.45rem;
  letter-spacing: 3px;
  color: var(--uim-navy-2);
  margin-bottom: 0.15rem;
}

.login-box h1 i {
  display: none;
}

.login-org {
  text-align: center;
  font-size: 0.7rem;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--uim-muted);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.login-box .sub {
  text-align: center;
  border-left: none;
  padding-left: 0;
  margin-bottom: 1.6rem;
  color: var(--uim-blue-dark);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.login-box input:focus {
  border-color: var(--uim-blue);
  box-shadow: 0 0 0 3px rgba(20, 134, 196, 0.15);
}

.login-btn {
  background: linear-gradient(135deg, var(--uim-red), var(--uim-red-dark));
  border-radius: 10px;
  letter-spacing: 0.4px;
  box-shadow: 0 8px 20px rgba(200, 40, 45, 0.28);
}

.login-btn:hover {
  background: linear-gradient(135deg, var(--uim-red-dark), #8a161a);
}

.login-box .hint a {
  color: var(--uim-red);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .topbar .brand-logo {
    height: 34px;
  }

  .topbar .brand-text small {
    display: none;
  }

  .login-logo img {
    width: 140px;
  }
}

@media (max-width: 480px) {
  .topbar .brand-text b {
    font-size: 0.95rem;
    letter-spacing: 2px;
  }
}

/* ============================================================
   THEME PLAT - couleurs unies (sans degrade rouge/bleu)
   ============================================================ */
.topbar,
.topbar.fixed-header {
  background: #0b2239;
}

.sidebar {
  background: #102a43;
}

.menu-item.active > .menu-link {
  background: #1486c4;
  box-shadow: none;
}

.menu-item.active > .menu-link::before {
  display: none;
}

.main-content {
  background: #f3f6f9;
}

.page-title::after {
  background: #1486c4;
  box-shadow: none;
}

.card h2::before {
  background: #1486c4;
}

.login-page {
  background: #0b2239;
}

.login-btn {
  background: #c8282d;
  box-shadow: none;
}

.login-btn:hover {
  background: #a11d22;
}

.btn-primary,
.btn-info {
  background: #1486c4;
  border-color: #1486c4;
  box-shadow: none;
}

.btn-primary:hover,
.btn-info:hover {
  background: #0f6da3;
  border-color: #0f6da3;
}

.btn-danger {
  background: #c8282d;
  border-color: #c8282d;
  box-shadow: none;
}

.btn-danger:hover {
  background: #a11d22;
  border-color: #a11d22;
}

.btn-success {
  background: #5c8f1d;
  border-color: #5c8f1d;
}

.btn-success:hover {
  background: #47700f;
  border-color: #47700f;
}

.btn.btn-magic-edit {
  background: #1486c4;
  border-color: #1486c4;
  box-shadow: none;
}

.topbar,
.topbar.fixed-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
