/* ================= GLOBAL ================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  font-family: 'Segoe UI', sans-serif;
  background: #f5f7fa;
  color: #004a8e;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ================= HEADER ================= */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: #004a8e; /* bleu EILCO */
  color: white;
  display: flex;
  align-items: center;
  justify-content: center; /* centre le contenu */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  text-align: center;
}

.header-logo {
  height: 50px;
  width: auto;
  filter: brightness(0) invert(1); /* rend le logo blanc si sombre */
  transition: filter 0.3s ease;
}



.header h1 {
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0;
  color: #ffffff;
}

/* Espace sous le header */
body {
  padding-top: 90px;
}

/* ================= LAYOUT PRINCIPAL ================= */
.dashboard {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: center;
  width: 100%;
  max-width: 1800px;
  margin: 0 auto;
  padding: 0 12px 40px;
}

/* ================= BLOCS ================= */
.card-block {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  padding: 18px 22px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.18s ease;
  flex: 1 1 320px; /* pour que les blocs se replient proprement */
  min-height: 120px;
  max-width: 520px;
}

.card-block:hover {
  transform: translateY(-3px);
}

.card-block h2 {
  color: #004a8e;
  text-align: center;
  margin: 0 0 18px;
  font-size: 1.18rem;
}

/* ================= GRID D'APPS ================= */
.grid {
  display: grid;
  width: 100%;
  gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
}

/* ================= CARTES ================= */
.app-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #004a8e;
  background: #e9f1fb;
  border-radius: 10px;
  padding: 12px 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
  text-align: center;
  word-wrap: break-word;
}

.app-card:hover {
  transform: translateY(-4px);
  background: #d4e6fa;
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.10);
}

.app-card img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 8px;
  display: block;
}

.app-card span {
  font-size: 0.9rem;
  line-height: 1.2;
}

.app-card.blue {
  background: #edf2f7;
}

.app-card.blue:hover {
  background: #dde7f2;
}

/* ================= MEDIA QUERIES ================= */

/* Tablettes / grands téléphones */
@media (max-width: 1024px) {
  .dashboard {
    gap: 20px;
    padding: 0 14px 30px;
  }

  .card-block {
    flex: 1 1 520px;
    width: 100%;
    max-width: 900px;
    padding: 16px 18px 24px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
  }
}

/* Mobiles (<=600px) */
@media (max-width: 600px) {
  .header {
    height: 60px;
  }

  .header-logo {
    height: 38px;
  }

  .header h1 {
    font-size: 1.1rem;
  }

  body {
    padding-top: 75px;
  }

  .dashboard {
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 0 10px 20px;
  }

  .card-block {
    width: 100%;
    max-width: 720px;
    padding: 12px 14px 18px;
    flex: 1 1 100%;
    border-radius: 10px;
  }

  .card-block h2 {
    font-size: 1.05rem;
    margin-bottom: 12px;
  }

  .grid {
    grid-template-columns: repeat(2, 1fr); /* 2 colonnes sur mobile */
    gap: 10px;
  }

  .app-card {
    padding: 10px 8px;
  }

  .app-card img {
    width: 34px;
    height: 34px;
    margin-bottom: 6px;
  }

  .app-card span {
    font-size: 0.82rem;
  }
}

/* Très petits écrans */
@media (max-width: 360px) {
  .grid {
    grid-template-columns: 1fr 1fr;
  }

  .app-card img {
    width: 32px;
    height: 32px;
  }

  .app-card span {
    font-size: 0.78rem;
  }
}
