/* Design commun des tableaux de bord (menu*.php) - EC2LT
   Le rouge n'apparait qu'au survol (hover), le reste du temps l'accent est bleu marine. */

:root {
  --navy: #14225c;
  --navy-dark: #0c1740;
  --red: #ae2037;
  --red-dark: #8f1a2c;
  --bg: #eef1f6;
  --white: #ffffff;
  --gray-600: #6b7280;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
}

body.dashboard-body {
  font-family: 'Bookman Old Style', 'Poppins', sans-serif;
  background: var(--bg);
  margin: 0;
  min-height: 100vh;
}

/* ===== Barre de navigation ===== */
.topbar {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  box-shadow: 0 2px 10px rgba(20, 34, 92, 0.25);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 0;
}

.topbar-inner {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 24px;
  flex-wrap: wrap;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.navbar-toggler {
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 8px;
  padding: 6px 10px;
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

/* Bootstrap etire .navbar-collapse (flex-grow: 1) pour occuper tout l'espace
   restant : sans ceci, le bloc profil reste colle aux liens de nav au lieu
   d'etre plaque contre le bord droit, laissant un vide inutile a cote de lui. */
@media (min-width: 992px) {
  .navbar-collapse {
    justify-content: space-between;
  }
}

/* Sur mobile/tablette, le menu (liens + profil) se replie sous la marque */
@media (max-width: 991.98px) {
  .topbar-inner {
    padding: 10px 16px;
  }

  .navbar-collapse {
    flex-basis: 100%;
    width: 100%;
  }

  .navbar-collapse:not(.show) {
    display: none;
  }

  .navbar-collapse.show {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 8px;
  }
}

.topbar-brand img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--white);
  padding: 3px;
  box-sizing: border-box;
}

.topbar-brand .brand-text strong {
  display: block;
  color: var(--white);
  font-size: 15px;
  letter-spacing: 0.5px;
  line-height: 1.2;
}

.topbar-brand .brand-text small {
  display: block;
  color: rgba(255, 255, 255, 0.65);
  font-size: 10.5px;
  letter-spacing: 1px;
}

.topbar-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}

.topbar-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 78px;
  padding: 8px 12px;
  border-radius: 10px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-weight: 600;
  font-size: 11.5px;
  letter-spacing: 0.3px;
  text-align: center;
  transition: background-color 0.2s, color 0.2s, transform 0.2s;
  white-space: nowrap;
}

.topbar-nav a i {
  font-size: 17px;
}

.topbar-nav a.active {
  background: rgba(255, 255, 255, 0.14);
  color: var(--white);
}

.topbar-nav a:hover {
  background: var(--red);
  color: var(--white);
  transform: translateY(-1px);
}

@media (max-width: 991.98px) {
  .topbar-nav {
    flex-direction: column;
    gap: 2px;
    width: 100%;
  }

  .topbar-nav a {
    width: 100%;
  }
}

.topbar-profile {
  position: relative;
}

@media (min-width: 992px) {
  .topbar-profile {
    margin-left: 8px;
    padding-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
  }
}

@media (max-width: 991.98px) {
  .topbar-profile {
    width: 100%;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
  }

  .topbar-profile > a {
    width: 100%;
  }

  .topbar-profile .dropdown-menu {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: 100%;
    box-shadow: none;
    border: none;
    margin-top: 4px;
  }
}

.topbar-profile > a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--white);
  padding: 6px 12px;
  border-radius: 12px;
  transition: background-color 0.2s;
}

.topbar-profile > a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.topbar-profile .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--white);
  color: var(--navy);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}

.topbar-profile .avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.topbar-profile .profile-text strong {
  display: block;
  font-size: 14px;
  color: var(--white);
  line-height: 1.2;
}

.topbar-profile .profile-text small {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

.topbar-profile .dropdown-menu {
  border-radius: 12px;
  border: 1px solid var(--gray-200);
  box-shadow: 0 12px 30px rgba(20, 34, 92, 0.15);
  padding: 6px;
}

.topbar-profile .dropdown-item {
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13.5px;
  font-weight: 500;
}

.topbar-profile .dropdown-item:hover {
  background: var(--red);
  color: var(--white);
}

/* ===== Contenu principal ===== */
.dashboard-main {
  max-width: 1300px;
  margin: 0 auto;
  padding: 30px 24px 110px;
}

.dashboard-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}

.hero-eyebrow {
  display: block;
  color: var(--red);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 2px;
}

.dashboard-hero h1 {
  color: var(--navy);
  font-size: 30px;
  font-weight: 700;
  margin: 6px 0 10px;
}

.hero-underline {
  width: 56px;
  height: 4px;
  background: var(--red);
  border-radius: 2px;
  margin-bottom: 14px;
}

.dashboard-hero p {
  color: var(--gray-600);
  max-width: 520px;
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

.hero-info {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.info-box {
  background: var(--white);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 4px 14px rgba(20, 34, 92, 0.08);
  min-width: 210px;
  transition: transform 0.2s, box-shadow 0.2s;
}

.info-box .info-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.info-box .info-text span {
  display: block;
  font-size: 10.5px;
  color: var(--gray-600);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.info-box .info-text strong {
  display: block;
  font-size: 17px;
  color: var(--navy);
}

#annee-clickable {
  cursor: pointer;
}

#annee-clickable:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(20, 34, 92, 0.15);
}

/* ===== Grille des cartes ===== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.dashboard-card {
  position: relative;
  display: block;
  background: var(--white);
  border-radius: 16px;
  padding: 26px 22px 22px;
  box-shadow: 0 4px 14px rgba(20, 34, 92, 0.06);
  border: 1px solid var(--gray-200);
  text-decoration: none;
  transition: transform 0.25s, box-shadow 0.25s, border-color 0.25s;
}

.dashboard-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 32px rgba(224, 36, 42, 0.18);
  border-color: var(--red);
}

.dashboard-card .card-icon {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
  transition: background-color 0.25s;
}

.dashboard-card:hover .card-icon {
  background: var(--red);
}

.dashboard-card h3 {
  color: var(--navy);
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 8px;
  transition: color 0.2s;
}

.dashboard-card:hover h3 {
  color: var(--red);
}

.dashboard-card p {
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
  padding-right: 34px;
}

.dashboard-card .card-arrow {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: background-color 0.25s, transform 0.25s;
}

.dashboard-card:hover .card-arrow {
  background: var(--red);
  transform: translateX(3px);
}

/* ===== Pied de page ===== */
.app-footer {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-dark) 100%);
  color: #cbd3ef;
  text-align: center;
  padding: 14px 20px;
  font-size: 12.5px;
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  z-index: 900;
  box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.15);
}

.app-footer p {
  margin: 0;
  line-height: 1.6;
  opacity: 0.9;
}

/* ===== Responsive : tablettes ===== */
@media (max-width: 991.98px) {
  .dashboard-main {
    padding: 24px 16px 130px;
  }

  .dashboard-hero {
    flex-direction: column;
  }

  .hero-info {
    width: 100%;
  }

  .info-box {
    flex: 1 1 220px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
  }
}

/* ===== Responsive : mobiles ===== */
@media (max-width: 575.98px) {
  .topbar-brand img {
    width: 36px;
    height: 36px;
  }

  .topbar-brand .brand-text strong {
    font-size: 13px;
  }

  .dashboard-main {
    padding: 20px 12px 170px;
  }

  .hero-eyebrow {
    font-size: 11px;
  }

  .dashboard-hero h1 {
    font-size: 24px;
    margin: 4px 0 8px;
  }

  .dashboard-hero p {
    font-size: 13px;
  }

  .hero-info {
    flex-direction: column;
  }

  .info-box {
    width: 100%;
    min-width: 0;
  }

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

  .dashboard-card {
    padding: 20px 18px 18px;
  }

  .dashboard-card p {
    padding-right: 0;
    margin-bottom: 30px;
  }

  .dashboard-card .card-arrow {
    right: 18px;
    bottom: 18px;
  }

  .app-footer {
    font-size: 10.5px;
    padding: 10px 12px;
  }
}
