/* ============================================================
   Design system — Plateforme de formation Prestalibre
   Cohérent avec l'identité visuelle Observatoire Vivant
   ============================================================ */

:root {
  --navy: #1e3a5f;
  --navy-light: #2a4f7f;
  --blue: #2563eb;
  --blue-light: #93c5fd;
  --green: #00b894;
  --orange: #f59e0b;
  --red: #e17055;
  --red-strong: #dc2626;
  --gold: #C6A75E;
  --gray-50: #f8fafc;
  --gray-100: #f0f4ff;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-700: #334155;
  --gray-900: #1a202c;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
  background: var(--gray-50);
  color: var(--gray-900);
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { color: var(--navy); font-weight: 800; margin: 0 0 12px; }
h1 { font-size: 1.6em; }
h2 { font-size: 1.2em; margin-top: 28px; }
h3 { font-size: 1.02em; }

/* ── Layout général (pages centrées : login/register) ── */
.container {
  max-width: 480px;
  margin: 60px auto;
  padding: 32px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-200);
}

.container.wide {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0;
  background: transparent;
  box-shadow: none;
  border: none;
}

/* ── Topbar app (dashboard / espace élève) ── */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topbar .brand {
  font-weight: 800;
  font-size: 1.05em;
  letter-spacing: 0.2px;
}
.topbar .brand .dot { color: var(--gold); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }

.app-content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 28px 20px 60px;
}

/* ── Breadcrumb / retour ── */
.breadcrumb {
  font-size: 0.88em;
  color: var(--gray-500);
  margin-bottom: 16px;
}
.breadcrumb a { color: var(--blue); font-weight: 600; }

/* ── Cards ── */
.card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}
.card h2 { margin-top: 0; }

/* ── Forms ── */
form { margin-bottom: 8px; }
label {
  display: block;
  margin-bottom: 14px;
  font-size: 0.88em;
  font-weight: 600;
  color: var(--gray-700);
}
input[type="text"], input[type="email"], input[type="password"],
input[type="date"], input[type="number"], input[type="url"], select, textarea {
  display: block;
  width: 100%;
  padding: 10px 12px;
  margin-top: 6px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  font-size: 0.95em;
  font-family: inherit;
  background: #fff;
  color: var(--gray-900);
  transition: border-color 0.15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
input[type="file"] { padding: 8px 0; border: none; }

button, .btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92em;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
  font-family: inherit;
}
button:hover, .btn:hover { background: #1d4ed8; }
button:active { transform: scale(0.98); }
button.secondary { background: var(--gray-500); }
button.secondary:hover { background: var(--gray-700); }
button.danger { background: var(--red-strong); }
button.danger:hover { background: #b91c1c; }
button.small { padding: 6px 12px; font-size: 0.82em; }

.error {
  color: var(--red-strong);
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 0.88em;
  margin: 10px 0;
}
.success-box {
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  color: #065f46;
  font-size: 0.9em;
  margin: 12px 0;
}
.info-box {
  background: var(--gray-100);
  border-left: 4px solid var(--navy);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 0.88em;
  margin: 12px 0;
}

/* ── Listes ── */
ul.list { list-style: none; padding: 0; margin: 0; }
ul.list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: #fff;
  transition: box-shadow 0.15s;
}
ul.list li:hover { box-shadow: var(--shadow-md); }
ul.list li .item-title { font-weight: 700; color: var(--navy); }
ul.list li .item-meta { color: var(--gray-500); font-size: 0.85em; }
ul.list li .clickable { cursor: pointer; flex: 1; }
ul.list li .actions { display: flex; gap: 6px; }
ul.list li .drag-handle { color: var(--gray-400); margin-right: 10px; cursor: grab; user-select: none; }
ul.list li.drag-over { border-color: var(--blue, #2563eb); box-shadow: 0 0 0 2px var(--blue, #2563eb) inset; }

/* ── Badges statut ── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.badge.brouillon { background: var(--gray-200); color: var(--gray-700); }
.badge.a_venir { background: #fef3c7; color: #92400e; }
.badge.active { background: #d1fae5; color: #065f46; }
.badge.terminee { background: #dbeafe; color: #1e40af; }

/* ── Tableau de suivi ── */
table.suivi {

/* ── Header bar (dashboard crypto) ── */
.header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.header-bar h1 { margin: 0; }

/* ── Alert box (kill switch) ── */
.alert-box {
  border-radius: var(--radius);
  padding: 18px 22px;
  margin-bottom: 24px;
}
.alert-box.danger {
  background: #fef2f2;
  border: 2px solid var(--red-strong);
  color: #7f1d1d;
}
.alert-box.danger strong { font-size: 1.1em; }
.alert-box.danger button { margin-top: 10px; }

/* ── Stats grid ── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-label {
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--gray-500);
  font-weight: 700;
}
.stat-value {
  font-size: 1.5em;
  font-weight: 800;
  color: var(--navy);
}
.stat-value.positif { color: var(--green); }
.stat-value.negatif { color: var(--red-strong); }

td.positif { color: var(--green); font-weight: 700; }
td.negatif { color: var(--red-strong); font-weight: 700; }

.position-ouverte {
  border-left: 4px solid var(--blue);
}
