/* === Structure générale === */
body {
  margin: 0;
  font-family: "Segoe UI", sans-serif;
  background: #f7f7f7;
  color: #444;
  line-height: 1.6;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1em;
}

header, footer {
  background: #eeeeee;
  color: #444;
  padding: 1.2em 0;
  border-radius: 0 0 10px 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* === Header disposition === */
header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
}

header nav {
  display: flex;
  align-items: center;
  gap: 1em;
}

h1, h2 {
  color: #333;
  font-weight: 600;
  margin-top: 0;
}

nav a {
  color: #555;
  margin: 0 10px;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s ease;
  display: inline-block;
}

nav a:hover {
  color: #222;
}

main {
  background: #ffffff;
  padding: 2em;
  margin-top: 1em;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* === Tableaux === */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1em;
  font-size: 0.95em;
  background: white;
}

th {
  background: #f2f2f2;
  color: #444;
  font-weight: 600;
  padding: 0.75em;
  border-bottom: 1px solid #ddd;
  text-align: left;
}

td {
  padding: 0.75em;
  border-bottom: 1px solid #eee;
}

tr:nth-child(even) {
  background-color: #fafafa;
}

/* === Boutons généraux === */
.btn {
  background: transparent;
  color: #225c22;
  padding: 0.4em 0.9em;
  border: 1px solid #225c22;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.9em;
  text-decoration: none;
  display: inline-block;
  margin-top: 0.8em;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: #eaf7ea;
  color: #1b4b1b;
  border-color: #1b4b1b;
  transform: translateY(-1px);
}

/* === Formulaires === */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 0.5em;
  margin-top: 0.5em;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 1em;
  box-sizing: border-box;
  background-color: #fff;
}

label span {
  font-weight: 500;
  display: block;
  margin-top: 1em;
  color: #555;
}

input[type="submit"],
button[type="submit"] {
  background: transparent;
  color: #225c22;
  border: 1px solid #225c22;
  padding: 0.4em 0.9em;
  border-radius: 5px;
  font-weight: 500;
  font-size: 0.9em;
  cursor: pointer;
  margin-top: 0.8em;
  transition: background 0.2s ease, transform 0.1s ease;
}

input[type="submit"]:hover,
button[type="submit"]:hover {
  background: #eaf7ea;
  border-color: #1b4b1b;
  color: #1b4b1b;
  transform: translateY(-1px);
}

/* === Groupes d'entrée (sous-domaine) === */
.input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 0.5em;
  max-width: 350px;
}

.input-group input[type="text"] {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  box-sizing: border-box;
}

.input-group .suffix {
  white-space: nowrap;
  padding-left: 6px;
  font-size: 15px;
  color: #666;
  font-weight: 500;
}

/* === Lien configuration générale === */
.link-config {
  display: inline-block;
  margin-top: 1.5em;
  text-decoration: none;
  color: #0a7d36;
  border: 1px solid #0a7d36;
  padding: 0.4em 0.8em;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.link-config:hover {
  background: #0a7d36;
  color: #fff;
}

/* === Liste des écoles (Super-Admin) === */
.school-list {
  list-style: none;
  padding: 0;
  margin: 1.5em 0;
}

.school-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.8em 1em;
  margin-bottom: 0.8em;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.school-info {
  font-weight: 500;
}

.school-domain {
  color: #777;
  font-size: 0.9em;
  margin-left: 0.3em;
}

.school-actions {
  display: flex;
  gap: 0.6em;
}

/* Liens vers les sous-domaines dans la liste d'écoles */
.school-list .domain-link,
.school-list .domain-link:link,
.school-list .domain-link:visited {
  color: #444 !important;
  text-decoration: none !important;
  font-weight: 500;
  border-bottom: 1px solid #ccc;
  padding-bottom: 1px;
  transition: all 0.2s ease;
}

.school-list .domain-link:hover {
  color: #007b5e !important;
  border-bottom-color: #007b5e !important;
  text-decoration: none !important;
}

/* --- Boutons slim --- */
.btn-slim {
  font-size: 0.9em;
  padding: 0.3em 0.9em;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

a.btn-slim,
.school-actions a.btn-slim {
  text-decoration: none;
  display: inline-block;
  cursor: pointer;
}

.btn-slim.config {
  background: #e6f0ff;
  border-color: #3978d4;
  color: #1e4d8f;
}

.btn-slim.config:hover {
  background: #3978d4;
  color: #fff;
}

.btn-slim.danger {
  background: #ffeaea;
  border-color: #c0392b;
  color: #a3261e;
}

.btn-slim.danger:hover {
  background: #c0392b;
  color: #fff;
}

/* === Menu utilisateur === */
.user-menu {
  position: relative;
  display: inline-block;
  vertical-align: top;
}

#user-menu-trigger {
  font-weight: 500;
  text-decoration: none;
  color: #444;
  cursor: pointer;
}

#user-menu-trigger:hover {
  color: #00796b;
}

.user-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: 100%;
  margin-top: 0.4em;
  background-color: white;
  min-width: 180px;
  border: 1px solid #ccc;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  z-index: 100;
  text-align: left;
  animation: fadeIn 0.15s ease;
}

.user-dropdown a {
  display: block;
  padding: 0.6em 1em;
  text-decoration: none;
  color: #444;
  transition: background 0.15s ease;
}

.user-dropdown a:hover {
  background-color: #f5f5f5;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-3px); }
  to { opacity: 1; transform: translateY(0); }
}

/* === Responsive === */
@media (max-width: 768px) {
  .container {
    width: 95%;
    padding: 1em;
  }

  main {
    padding: 1.5em 1em;
  }

  table, thead, tbody, th, td, tr {
    display: block;
  }

  thead { display: none; }

  tr {
    margin-bottom: 1em;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    padding: 0.5em;
  }

  td {
    border: none;
    position: relative;
    padding-left: 50%;
  }

  td::before {
    position: absolute;
    top: 0.75em;
    left: 1em;
    width: 45%;
    font-weight: bold;
    color: #777;
    content: attr(data-label);
  }

  .school-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6em;
  }

  .school-actions {
    width: 100%;
  }
}
.tabs {
  margin-top: 1.5em;
  margin-bottom: 1em;
  display: flex;
  gap: 10px;
}

.tab-button {
  background: transparent;
  border: 1px solid #0a7d36;
  color: #0a7d36;
  padding: 0.4em 0.9em;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-button:hover {
  background: #eaf7ea;
  border-color: #0a7d36;
}

.tab-button.active {
  background: #eaf7ea;
  color: #1b4b1b;
  border-color: #1b4b1b;
}
/* === Header branding + responsive + fallback === */
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5em 0;
  flex-wrap: wrap;
}

.header-branding {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 70%;
  min-width: 200px;
}

.logo-link img {
  display: block;
  object-fit: contain;
  width: auto;
}

.root-logo {
  max-height: 50px;
}

.tenant-logo {
  max-height: 70px;
  max-width: 150px;
}

.school-name {
  font-family: 'Poppins', sans-serif;
  font-size: 1.65em;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

/* Mobile adaptation */
@media (max-width: 600px) {
  .header-branding {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    max-width: 100%;
  }

  .school-name {
    font-size: 1.3em;
    max-width: 100%;
  }

  nav {
    margin-top: 10px;
  }
}
.footer-link {
  color: inherit;         /* même couleur que le texte */
  text-decoration: none;  /* pas de soulignement */
  font-weight: 500;       /* légèrement plus visible */
  transition: opacity 0.2s ease;
}

.footer-link:hover {
  opacity: 0.7;           /* effet léger au survol */
}
/* === Boutons colorés === */

/* Bouton bleu (Modifier) */
.btn-slim.edit {
  background: #e6f0ff !important;
  border-color: #3978d4 !important;
  color: #1e4d8f !important;
}
.btn-slim.edit:hover {
  background: #3978d4 !important;
  color: #fff !important;
}

/* Bouton vert (Activer) */
.btn-slim.success {
  background: #e6ffea !important;
  border-color: #27ae60 !important;
  color: #1a6f3c !important;
}
.btn-slim.success:hover {
  background: #27ae60 !important;
  color: #fff !important;
}

/* Bouton rouge (Suspendre) - renforcement des couleurs */
.btn-slim.danger {
  background: #ffeaea !important;
  border-color: #c0392b !important;
  color: #a3261e !important;
}
.btn-slim.danger:hover {
  background: #c0392b !important;
  color: #fff !important;
}
.btn-icon {
  display: inline-block;
  text-decoration: none;
  cursor: pointer;
  color: #444;
  margin: 0 6px;
  transition: color 0.2s ease, transform 0.15s ease;
}

.btn-icon svg {
  vertical-align: middle;
  pointer-events: none; /* important: évite que le SVG bloque le clic */
}

.btn-icon.view:hover {
  color: #007bff;
  transform: scale(1.1);
}

.btn-icon.delete:hover {
  color: #d9534f;
  transform: scale(1.1);
}
