/* --- Variables de design globales --- */
:root {
  --bg-color: #f3f4f6;
  --card-bg: #ffffff;
  --primary-color: #2563eb;
  --text-main: #1f2937;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --success: #10b981;
  --danger: #ef4444;
}

/* --- Styles de Base & Layout --- */
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  padding-bottom: 40px;
}

/* --- Barre Supérieure --- */
.main-header {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.main-header h1 {
  margin: 0;
  font-size: 1.2rem;
}

.badge {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

/* --- Zone Principale & Grilles --- */
.dashboard-container {
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 15px; /* Espace entre chaque bloc */
}

/* Grille des cartes (2 colonnes côte à côte sur mobile) */
.stats-grid {
  display: grid;
  grid-template-cols: 1fr 1fr;
  gap: 12px;
}

/* Style des cartes individuelles */
.stat-card, .chart-section, .logs-section {
  background-color: var(--card-bg);
  padding: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.card-label {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
}

.card-value {
  margin: 5px 0;
  font-size: 1.5rem;
  font-weight: bold;
}

.trend {
  font-size: 0.75rem;
  font-weight: 600;
}

.trend-up { color: var(--success); }
.trend-down { color: var(--danger); }

/* --- Section Graphiques et Titres --- */
.section-title {
  margin: 0 0 12px 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-wrapper {
  position: relative;
  width: 100%;
  height: 220px; /* Hauteur idéale pour écran mobile */
}

/* --- Section Historique (Logs) --- */
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.log-item {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 6px;
}

.log-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.log-text { color: #374151; }
.log-time { color: var(--text-muted); font-family: monospace; }
