/* ================================= */
/*  Styles globaux & arrière‐plan    */
/* ================================= */
html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: 'Segoe UI', Arial, sans-serif;
  background-color: #f0f2f5;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* ==================================== */
/*   HEADER : TITRE  + LOGO + STATUT     */
/* ==================================== */
header {
  position: relative;
  text-align: center;
  padding: 12px 20px;
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid #ddd;
}

/* → TITRE PRINCIPAL (Pacifico, turquoise) ← */
header h1 {
  margin: 0.5em 0 0.2em;
  font-size: 2em;
  font-family: 'Pacifico', cursive;
  color: #008b8b; /* turquoise foncé */
  line-height: 1.3;
}

/* → LOGO (semi‐transparent) ← */
header #logo {
  position: absolute;
  top: 10px;
  right: 20px;
  width: 80px;
  height: auto;
  opacity: 0.7;
}

/* → STATUT (sous le logo) ← */
header #status {
  position: absolute;
  top: 100px;    /* placé juste sous le logo */
  right: 20px;
  font-size: 1em;
  color: #990000; /* rouge par défaut (déconnecté) */
  font-weight: bold;
}

/* ================================= */
/*        MAIN : DASHBOARD           */
/* ================================= */
#dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px;
  margin-top: 20px;
}

/* ======================== */
/* Chaque WIDGET (cadre)    */
/* ======================== */
.widget {
  background-color: rgba(255, 255, 255, 0.9);
  border: 1px solid #ccc;
  border-radius: 8px;
  box-shadow: 1px 1px 6px rgba(0, 0, 0, 0.1);
  padding: 12px;
  text-align: center;
}

/* ======================== */
/*   JAUGE (CO₂, Temp, …)   */
/* ======================== */
.gauge {
  width: 180px;
  height: 180px;
  margin: 0 auto;
}

/* Label juste sous la jauge */
.gauge-label {
  margin: 6px 0 10px;
  font-weight: bold;
  color: #333;
}

/* ======================== */
/* GRAPHIQUES (Chart.js)    */
/* ======================== */
.widget canvas {
  width: 100% !important;
  max-height: 150px;
  margin-top: 8px;
}

/* ======================== */
/*   BOUTON « CSV »         */
/* ======================== */
.btn-csv {
  margin-top: 10px;
  padding: 6px 12px;
  background-color: #007bff;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 0.9em;
  cursor: pointer;
  transition: background-color 0.2s;
}
.btn-csv:hover {
  background-color: #0069d9;
}

/* =========================== */
/*       RWD (Responsive)      */
/* =========================== */
@media (max-width: 1000px) {
  /* À moins de 1000px, passer à 2 colonnes */
  #dashboard {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 600px) {
  /* À moins de 600px, passer à 1 colonne */
  #dashboard {
    grid-template-columns: 1fr;
  }
  header #logo {
    width: 60px;
    top: 6px;
    right: 8px;
  }
  header h1 {
    font-size: 1.5em;
  }
  header #status {
    top: 80px;
    right: 8px;
    font-size: 0.9em;
  }
}
