
:root {
  --green: #075b36;
  --green-dark: #043c29;
  --green-light: #eaf4ee;
  --gold: #c9a447;
  --red: #b52d2d;
  --text: #20352a;
  --muted: #718078;
  --border: #dce7df;
  --background: #f2f6f3;
  --white: #ffffff;
  --shadow: 0 8px 28px #173d2810;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--background);
  color: var(--text);
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, var(--green-dark), var(--green));
  color: white;
  padding: 30px 20px;
  text-align: center;
  border-bottom: 4px solid var(--gold);
  box-shadow: 0 4px 18px #00000018;
}

header h1 {
  margin: 0;
  font-size: 32px;
  letter-spacing: 3px;
  font-weight: 800;
}

header p {
  margin: 9px 0 0;
  color: #e2eee6;
  font-size: 14px;
  letter-spacing: 1px;
}

main {
  width: 94%;
  max-width: 1200px;
  margin: 32px auto;
}

section {
  background: var(--white);
  padding: 26px;
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

h2, h3, h4 {
  color: var(--green);
}

h2 {
  font-size: 23px;
  margin-top: 0;
}

h3 {
  font-size: 20px;
  margin-top: 0;
}

h4 {
  font-size: 16px;
}

p {
  line-height: 1.6;
}

#loginSection {
  max-width: 470px;
  margin: 55px auto;
  padding: 35px;
}

#loginSection h2 {
  text-align: center;
  margin-bottom: 18px;
}

#loginSection > p {
  text-align: center;
  color: var(--muted);
  margin-bottom: 25px;
}

input {
  display: block;
  width: 100%;
  padding: 15px;
  margin: 16px 0;
  border: 1px solid #ccd8cf;
  border-radius: 9px;
  background: #fbfdfb;
  color: var(--text);
  font-size: 16px;
  outline: none;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px #075b3618;
}

button {
  background: var(--green);
  color: white;
  border: 0;
  padding: 13px 20px;
  border-radius: 9px;
  cursor: pointer;
  font-weight: bold;
  font-size: 14px;
  transition: background 0.2s, transform 0.2s;
}

button:hover {
  background: var(--green-dark);
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#loginForm button {
  width: 100%;
  margin-top: 8px;
  padding: 15px;
}

#dashboard {
  min-height: 300px;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 15px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.top h2 {
  margin: 0;
}

.top p {
  margin: 6px 0;
  color: var(--muted);
}

#userRole {
  color: var(--green) !important;
  font-weight: bold;
}

#logoutBtn {
  background: var(--red);
}

#logoutBtn:hover {
  background: #852020;
}

#message {
  font-weight: bold;
  color: var(--green);
  margin: 18px 0;
  overflow-wrap: anywhere;
}

/* ESPACES DES RESPONSABLES */

#directorDashboard,
#deputyDashboard,
#financeDashboard,
#secretariatDashboard {
  margin-top: 25px;
  background: #fbfdfb;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 25px;
  box-shadow: none;
}

#directorDashboard {
  border-top: 4px solid var(--gold);
}

#deputyDashboard {
  border-top: 4px solid #2878a8;
}

#financeDashboard {
  border-top: 4px solid #27815a;
}

#secretariatDashboard {
  border-top: 4px solid #7a65a8;
}

#directorContent,
#deputyContent,
#financeContent,
#secretariatContent {
  margin-top: 20px;
}

#directorContent h4,
#deputyContent h4,
#financeContent h4,
#secretariatContent h4 {
  margin-bottom: 8px;
}

#directorContent p,
#deputyContent p,
#financeContent p,
#secretariatContent p {
  color: var(--muted);
}

/* CARTES DES APPRENANTS */

#learners {
  margin-top: 20px;
}

.learner-card {
  background: white;
  border: 1px solid var(--border);
  border-left: 5px solid var(--gold);
  border-radius: 12px;
  padding: 20px;
  margin-top: 16px;
  box-shadow: 0 4px 14px #00000008;
}

.learner-card h3 {
  color: var(--green);
  font-size: 18px;
  margin: 0 0 13px;
}

.learner-card p {
  color: var(--muted);
  font-size: 14px;
  margin: 7px 0;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
  padding-top: 15px;
  border-top: 1px solid #edf1ed;
}

.approve {
  background: #087844;
}

.reject {
  background: var(--red);
}

/* RESPONSIVE */

@media (max-width: 600px) {
  header {
    padding: 24px 15px;
  }

  header h1 {
    font-size: 27px;
  }

  main {
    width: 94%;
    margin: 20px auto;
  }

  section {
    padding: 19px;
    border-radius: 12px;
  }

  #loginSection {
    margin: 30px auto;
    padding: 24px 18px;
  }

  h2 {
    font-size: 20px;
  }

  .top {
    align-items: stretch;
  }

  #logoutBtn {
    width: 100%;
  }

  #directorDashboard,
  #deputyDashboard,
  #financeDashboard,
  #secretariatDashboard {
    padding: 17px;
  }

  .learner-card {
    padding: 16px;
  }

  .actions button {
    flex: 1;
    min-width: 110px;
  }
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid #c9a44788;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}
.director-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 15px;
  margin: 20px 0 30px;
}

.stat-card {
  background: white;
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 14px #00000008;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.stat-card strong {
  display: block;
  color: var(--green);
  font-size: 30px;
  margin-top: 10px;
}

#staffForm {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
}

#staffForm input,
#staffForm select {
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
}

#staffForm button {
  grid-column: 1 / -1;
}

#staffMessage {
  font-weight: bold;
}

#staffList {
  margin-top: 15px;
}

@media (max-width: 600px) {
  #staffForm {
    grid-template-columns: 1fr;
  }
}

