/* ===== RESET ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ===== FOND GLOBAL ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  min-height: 100vh;
  color: #0f172a;
  background-color: #020617;
  position: relative;
  overflow-x: hidden;
}

/* Image de fond + flou */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: url("fond.webp");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  filter: blur(3px) brightness(0.65);
  transform: scale(1.03);
}

/* Voile sombre + vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.22), transparent 55%),
    radial-gradient(circle at 0% 100%, rgba(52, 211, 153, 0.18), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(59, 130, 246, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(15, 23, 42, 0.92), rgba(15, 23, 42, 0.96));
  pointer-events: none;
}

/* ===== HEADER / LOGO ===== */
.header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.92));
  border-bottom: 1px solid rgba(148, 163, 184, 0.3);
  padding: 10px 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
}

/* Chip EcoPilote */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 26px;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 0%, #7df9ff 0%, #e0f2fe 35%, #0369a1 100%);
  box-shadow:
    0 18px 40px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(148, 163, 184, 0.4);
  color: #0f172a;
}

.brand-logo {
  display: none; /* tu pourras activer un petit pictogramme plus tard si tu veux */
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-main {
  font-size: 22px;
  font-weight: 800;
}

.brand-sub {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.95;
}

/* Lien "Retour" dans le header */
.header-back {
  margin-left: auto;
  font-size: 14px;
}

.header-back a {
  color: #e5e7eb;
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.35), transparent 60%);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.65);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.header-back a:hover {
  transform: translateY(-1px);
  background: radial-gradient(circle at 0% 0%, rgba(148, 163, 184, 0.55), transparent 55%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.9);
}

/* ===== CONTENEUR PRINCIPAL ===== */
.dashboard {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 32px 80px;
  display: flex;
  justify-content: center;
}

/* Grille de cartes (dashboard principal & sous-pages) */
.cards-grid {
  width: 100%;
  max-width: 1120px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

/* ===== CARTES ===== */
.card {
  position: relative;
  background: rgba(248, 250, 252, 0.98);
  border-radius: 22px;
  padding: 22px 22px 20px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow:
    0 18px 46px rgba(15, 23, 42, 0.55),
    0 0 0 1px rgba(148, 163, 184, 0.28);
  overflow: hidden;
  isolation: isolate;
}

/* Halo LED autour des cartes */
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.45), rgba(56, 189, 248, 0.4), rgba(37, 99, 235, 0.4));
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

/* Halo interne doux */
.card::after {
  content: "";
  position: absolute;
  inset: 30% 20% -40%;
  border-radius: 999px;
  background: radial-gradient(circle at 50% 0%, rgba(56, 189, 248, 0.22), transparent 60%);
  filter: blur(24px);
  opacity: 0.55;
  pointer-events: none;
}

/* Effet hover */
.card:hover::before {
  opacity: 0.95;
}

.card:hover {
  transform: translateY(-2px);
  transition: transform 0.16s ease;
}

/* ===== TYPO DANS LES CARTES ===== */

/* Titres principaux dans les cartes */
.card h3 {
  font-size: 22px;
  font-weight: 800;
  color: #0284c7;
  margin-bottom: 10px;
}

/* Texte descriptif */
.card p {
  font-size: 14px;
  color: #0f172a;
}

/* Listes bulletées dans les cartes (dashboard + autres pages) */
.card ul {
  list-style: disc;
  margin-left: 18px;
  margin-top: 8px;
}

.card ul li {
  font-size: 13px;
  color: #334155;
  margin-bottom: 4px;
}

/* Liens dans les cartes */
.card a {
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(3, 105, 161, 0.8);
}

/* Petit texte d’aide / notes */
.card small {
  font-size: 12px;
  color: #64748b;
}

/* ===== TABLEAUX DANS LES CARTES ===== */

/*
  Objectif :
  - garder les cartes propres
  - avoir des tableaux lisibles
  - éviter que la dernière colonne disparaisse
*/

.card table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-top: 8px;
}

.card thead {
  background: rgba(241, 245, 249, 0.9);
}

.card th,
.card td {
  padding: 6px 8px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(148, 163, 184, 0.35);
  white-space: nowrap;
}

.card th {
  font-weight: 600;
  color: #0f172a;
}

.card tbody tr:last-child td {
  border-bottom: none;
}

/* Si un tableau a beaucoup de colonnes,
   on pourra lui ajouter la classe "table-scroll"
   dans le HTML : <div class="card table-scroll">… */
.table-scroll {
  overflow-x: auto;
}

.table-scroll table {
  min-width: 640px;
}

/* ===== FOOTER ===== */
.footer {
  text-align: center;
  padding: 18px 24px 26px;
  font-size: 12px;
  color: #e5e7eb;
  text-shadow: 0 1px 3px rgba(15, 23, 42, 0.9);
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }

  .dashboard {
    padding: 24px 20px 60px;
  }
}

@media (max-width: 640px) {
  .cards-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .dashboard {
    padding: 18px 14px 40px;
  }

  .header {
    padding: 8px 12px;
  }

  .brand {
    padding: 8px 18px;
  }

  .brand-main {
    font-size: 20px;
  }

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