/* =========
   Base
   ========= */
:root{
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;

  /* Couleurs principales  */
  --primary: #00c3d0;     /* bouton AESH */
  --secondary: #6155f5;   /* bouton parent */

  /* Neutres */
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #6b7280;
  --border: #a7aebc;

  /* UI */
  --card: #ffffff;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
  --radius: 12px;

  /* Erreur (maquette : inputs rosés + texte rouge) */
  --error-bg: #fbe3e3;
  --error-border: #d07b7b;
  --error-text: #e11d48;

  /* Espacements */
  --space-1: 8px;
  --space-2: 12px;
  --space-3: 16px;
  --space-4: 20px;
  --space-5: 28px;
  --space-6: 36px;
}

*{ box-sizing: border-box; }
html, body{ height: 100%; }

body{
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
}

/* =========
   Page login
   ========= */
.auth-page{
  /* Layout centré */
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 48px);
}

.auth-wrap{
  width: 100%;
  max-width: 760px; 
  text-align: center;
}

.auth-header{
  margin-bottom: var(--space-5);
}

.auth-title{
  margin: 0;
  font-size: clamp(30px, 3.2vw, 44px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.auth-subtitle{
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.4;
}

/* =========
   Card
   ========= */
.card{
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.auth-card{
  padding: clamp(18px, 3vw, 28px);
  text-align: left; 
}

/* =========
   Form / champs
   ========= */
.form{
  display: grid;
  gap: var(--space-4);
}

.field{
  display: grid;
  gap: 10px;
}

.label{
  font-weight: 700;
  font-size: 16px;
}

.input{
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  font-size: 16px;
  outline: none;
  background: #fff;
}

.input::placeholder{
  color: rgba(15, 23, 42, 0.35);
}

.input:focus{
  border-color: rgba(0, 195, 208, 0.75);
  box-shadow: 0 0 0 4px rgba(0, 195, 208, 0.15);
}

.input.is-error{
  background: var(--error-bg);
  border-color: var(--error-border);
}

.field-error{
  margin: 0;
  color: var(--error-text);
  font-size: 15px;
  line-height: 1.3;
}

/* Ligne lien */
.form-row{
  display: flex;
  justify-content: flex-start;
}

.link{
  color: #111827;
  text-decoration: underline;
  font-size: 15px;
}

/* =========
   Boutons
   ========= */
.form-actions{
  display: grid;
  gap: 12px;
  margin-top: 6px;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  border-radius: 10px;
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease;
  user-select: none;
}

.btn:active{
  transform: translateY(1px);
}

.btn-primary{
  background: var(--primary);
  color: #f8fafc;
}

.btn-secondary{
  background: var(--secondary);
  color: #f8fafc;
}

.btn:hover{
  filter: brightness(0.98);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

/* =========
   Responsive
   ========= */
@media (max-width: 520px){
  .auth-wrap{ max-width: 100%; }
  .auth-card{ padding: 18px; }
  .input{ height: 50px; }
  .btn{ height: 44px; font-size: 15px; }
}

/* =========
   Layout pages (header + contenu + footer)
   ========= */
.page{
  min-height: calc(100vh - 98px - 76px);
  background: #ffffff;
}

.page__inner{
  max-width: 1100px; 
  margin: 0 auto;
  padding: 22px 18px 40px;
}

/* =========
   Topbar (header)
   ========= */
.topbar{
  height: 98px;
  background: #ffffff;
  border: 1px solid #8799be;
  box-shadow: 0 4px 10px rgba(0,0,0,0.18);
}

.topbar__inner{
  max-width: 1100px;
  height: 98px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand{
  font-size: 32px;
  font-weight: 700;
  color: #262626;
  text-decoration: none;
  letter-spacing: -0.03em;
}

.nav{
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 80px;
  flex: 1;
}

.nav__link{
  color: #525252;
  text-decoration: none;
  font-weight: 500;
  font-size: 16px;
}

.nav__link.is-active{
  color: #3b82f6;
  font-weight: 700;
  text-decoration: underline;
}

.avatar{
  text-decoration: none;
}

.avatar__circle{
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  border: 4px solid #3b82f6;
  background: #ffffff;
}

/* =========
   Footer
   ========= */
.footer{
  height: 76px;
  background: #f8fafb;
  box-shadow: 0 1px 7px rgba(0,0,0,0.25);
}

.footer__inner{
  max-width: 1100px;
  height: 76px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
}

.footer__text{
  margin: 0;
  color: #525252;
  font-size: 16px;
}

/* =========
   Dashboard components
   ========= */
.today-card{
  width: 230px;
  background: #dbeafe;
  border: 3px solid #3b82f6;
  border-radius: 12px;
  padding: 10px 14px;
  margin: 14px 0 22px;
}

.today-card__label{
  color: #3b82f6;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 2px;
}

.today-card__date{
  color: #1f2937;
  font-size: 18px;
  font-weight: 500;
  text-transform: capitalize;
}

.summary{
  background: #e5e7eb;
  border-radius: 10px;
  padding: 22px 22px 18px;
}

.summary__title{
  margin: 0 0 14px;
  font-size: 18px;
  font-weight: 700;
  color: #1f2937;
}

.progress__track{
  height: 16px;
  background: #6b7280;
  border-radius: 999px;
  overflow: hidden;
  display: flex;
}

.progress__done{ background: #22c55e; height: 100%; }
.progress__doing{ background: #fbbf24; height: 100%; }

.stats{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.stat{
  border-radius: 10px;
  padding: 16px;
  text-align: center;
}

.stat__value{
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 6px;
}

.stat__label{
  font-size: 13px;
}

.stat--done{ background: #f0fdf4; }
.stat--done .stat__value,
.stat--done .stat__label{ color: #22c55e; }

.stat--doing{ background: #fefce8; }
.stat--doing .stat__value{ color: #fbbf24; }
.stat--doing .stat__label{ color: #ffc022; }

.stat--todo{
  background: #e5e5e7;
  border: 1px solid #9ca3af;
}
.stat--todo .stat__value,
.stat--todo .stat__label{ color: #6b7280; }

.filters{
  margin: 18px auto 26px;
  max-width: 720px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 18px 18px;
}

.filters__grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.filters__label{
  display: block;
  margin-bottom: 8px;
  color: #354152;
  font-size: 14px;
  font-weight: 500;
}

.select{
  width: 100%;
  height: 34px;
  border-radius: 6px;
  border: 1px solid #334a5e;
  background: #ebf0f1;
  padding: 0 10px;
  font-size: 14px;
}

.cards__grid{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.student-card{
  background: #ffffff;
  border-radius: 14px;
  padding: 14px 14px 12px;
  display: grid;
  gap: 14px;
  border: 3px solid transparent;
}

.student-card__header{
  display: flex;
  align-items: center;
  gap: 14px;
}

.student-card__avatar{
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
}

.student-card__name{
  font-size: 14px;
  font-weight: 500;
  color: #000;
}

.student-card__status{
  font-size: 13px;
  font-weight: 400;
}

.student-card--done{ border-color: #22c55e; }
.student-card--doing{ border-color: #fbbf24; }
.student-card--todo{ border-color: #6b7280; }

.student-card__status--done{ color: #22c55e; }
.student-card__status--doing{ color: #f59e0b; }
.student-card__status--todo{ color: #9ca3af; }

.btn-dark{
  background: #264e86;
  color: #ffffff;
}

/* Responsive */
@media (max-width: 900px){
  .nav{ gap: 32px; }
  .cards__grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px){
  .topbar__inner{ padding: 0 14px; }
  .brand{ font-size: 24px; }
  .nav{ display: none; } 
  .stats{ grid-template-columns: 1fr; }
  .filters__grid{ grid-template-columns: 1fr; }
  .cards__grid{ grid-template-columns: 1fr; }
  .today-card{ width: 100%; }
}

/* ========================= */
/* PAGE ÉLÈVES               */
/* ========================= */

.page-title{
  margin: 14px 0 18px;
  font-size: 32px;
  font-weight: 700;
}

.backlink{
  display: inline-block;
  margin-top: 10px;
  color: #495565;
  text-decoration: underline;
  font-size: 14px;
  font-weight: 500;
}

/* bloc recherche */
.panel{
  border: 1px solid #99a1af;
  border-radius: 10px;
  padding: 18px 20px;
  margin: 14px 0 18px;
  background: #fff;
}

.panel__label{
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 14px;
}

.panel__row{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.search{
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid #99a1af;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.search__icon{ opacity: 0.7; }

.search__input{
  border: 0;
  width: 100%;
  font-size: 16px;
  outline: none;
}

.btn-add{
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 18px;
}

.btn-add__icon{
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(255,255,255,0.18);
}

/* table */
.table-wrap{
  overflow: auto;
  border-radius: 12px;
  border: 1px solid #eef2f7;
  box-shadow: 0 10px 22px rgba(15,23,42,0.06);
}

.table{
  width: 100%;
  border-collapse: collapse;
  min-width: 900px;
}

.table thead th{
  background: #e5e7eb;
  color: #364153;
  font-size: 14px;
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
}

.table tbody td{
  padding: 14px 16px;
  border-top: 1px solid #eef2f7;
  background: #fff;
  vertical-align: middle;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}

.th-actions, .td-actions{
  text-align: right;
  width: 120px;
  position: relative;
}

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

.avatar-mini{
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: #f1f5f9;
  display: grid;
  place-items: center;
}

.studentname{
  color: #101727;
  text-decoration: none;
  font-weight: 600;
}
.studentname:hover{ text-decoration: underline; }

.muted{
  color: #495565;
  font-weight: 400;
  font-size: 14px;
}

.pill{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
}
.pill--green{
  background: #f0fdf4;
  color: #008236;
}

/* menu actions */
.iconbtn{
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 20px;
}
.iconbtn:hover{ background: #f1f5f9; }

.menu{
  position: absolute;
  right: 10px;
  top: 52px;
  width: 190px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  box-shadow: 0 14px 30px rgba(15,23,42,0.12);
  overflow: hidden;
  z-index: 50;
}

.menu__item{
  width: 100%;
  display: block;
  padding: 12px;
  border: 0;
  background: #fff;
  text-align: left;
  font-size: 14px;
  font-weight: 500;
  color: #111827;
  cursor: pointer;
  text-decoration: none;
}
.menu__item:hover{ background: #f1f5f9; }

.is-hidden{ display: none !important; }

/* modal */
.modal{
  position: fixed;
  inset: 0;
  z-index: 200;
}

.modal__backdrop{
  position: absolute;
  inset: 0;
  background: rgba(15,23,42,0.35);
}

.modal__panel{
  position: relative;
  width: min(840px, 92vw);
  margin: 7vh auto;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0,0,0,0.25);
  overflow: hidden;
}

.modal__header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5e7eb;
}

.modal__title{
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 16px;
}

.modal__close{
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
}

.modal__body{
  padding: 16px 18px 18px;
}

.modal__section{
  font-size: 11px;
  font-weight: 700;
  color: #6b7280;
  margin: 6px 0 10px;
  letter-spacing: 0.06em;
}

.form-grid{
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field--full{ grid-column: 1 / -1; }

.textarea{
  width: 100%;
  border-radius: 10px;
  border: 1.5px solid #a7aebc;
  padding: 10px 12px;
  font-size: 15px;
  outline: none;
  resize: vertical;
}
.textarea:focus{
  border-color: rgba(0,195,208,0.75);
  box-shadow: 0 0 0 4px rgba(0,195,208,0.15);
}

.modal__actions{
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal__actions--split{
  justify-content: space-between;
}

/* responsive */
@media (max-width: 800px){
  .panel__row{ grid-template-columns: 1fr; }
  .form-grid{ grid-template-columns: 1fr; }
}

.alert{
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 700;
  margin: 12px 0 16px;
}
.alert--success{
  background:#dcfce7;
  color:#166534;
}

.modal { display:none; position:fixed; inset:0; z-index:9999; }
.modal.is-open { display:block; }
.modal__overlay { position:absolute; inset:0; background:rgba(0,0,0,.45); }
.modal__content { position:relative; background:#fff; max-width:720px; margin:6vh auto; border-radius:16px; padding:18px; }
.modal__header { display:flex; align-items:center; justify-content:space-between; gap:10px; margin-bottom:12px; }
.modal__actions { display:flex; gap:10px; justify-content:flex-end; margin-top:14px; }
.form__grid { display:grid; grid-template-columns:1fr 1fr; gap:12px; }
.field--full { grid-column:1 / -1; }
.field label { display:block; font-weight:600; margin:6px 0; }
.field input, .field textarea { width:100%; padding:10px; border:1px solid #ddd; border-radius:12px; }
.modal__content{
  max-height: 85vh;
  overflow: auto;
}
/* Empêche le menu actions d'être coupé */
.table-wrap {
  overflow: visible !important;
}

.tablecard {
  overflow: visible !important;
}

/* Menu actions élève */
.menu {
  position: absolute;
  z-index: 1000;
}
