/* teacher/dashboard.css

   Tableau de bord : compteurs, barre de travail, filtres.

   Chargé par index.html, dans l'ordre de css/README.md. Ne pas changer cet
   ordre sans relire la section « Ordre de chargement ». */

/* ---------- bandeau de compteurs ---------- */

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-value { font-size: var(--fs-7); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }

.stat-label { font-size: var(--fs-2); color: var(--muted); }

.stat-alert { border-color: var(--primary); }

.stat-alert .stat-value { color: var(--primary); }

/* ---------- barre de travail ---------- */

.work-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.work-controls { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.segmented {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 2px;
}

.segmented button {
  background: none;
  border: none;
  border-radius: var(--r-sm);
  padding: 6px 12px;
  font: inherit;
  font-size: var(--fs-2);
  color: var(--muted);
  cursor: pointer;
}

.segmented button[aria-selected="true"] {
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
}

.search input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 8px 12px;
  font: inherit;
  font-size: var(--fs-3);
  color: var(--text);
  min-width: 220px;
}

/* ---------- états ---------- */

.state {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--s-5);
  text-align: center;
}

.state-title { margin: 0 0 4px; font-size: var(--fs-4); font-weight: 500; }

.state-text { margin: 0 0 16px; font-size: var(--fs-3); color: var(--muted); }

.state-text:last-child { margin-bottom: 0; }

.state-error { border-color: var(--red); }

/* ---------- adaptation aux écrans ---------- */

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 760px) {
  .work-head { align-items: stretch; }
  .work-controls { flex-direction: column; align-items: stretch; }
  .search input { min-width: 0; width: 100%; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; }
}

@media (max-width: 420px) {
  .stats { grid-template-columns: 1fr; }
}

.state-action { margin: var(--s-4) 0 0; text-align: center; }
