/* Style neutre provisoire — à remplacer par la charte de today.cadgroup.ch
   une fois le projet dashboard-cadschool accessible en référence. */
:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #1a1d23;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #1f3864;
  --accent-hover: #16294b;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --ok: #1e7a34;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; background: var(--accent); color: #fff;
}
.topbar .brand { font-weight: 600; letter-spacing: .02em; }
.topbar form { margin: 0; }
.topbar button { background: none; border: 1px solid rgba(255,255,255,.4); color: #fff; padding: 6px 12px; border-radius: 6px; cursor: pointer; }
.page { max-width: 480px; margin: 48px auto; padding: 0 16px; }
.page.wide { max-width: 960px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 10px;
  padding: 28px; box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
h1 { font-size: 20px; margin: 0 0 6px; }
h2 { font-size: 16px; margin: 24px 0 8px; }
p.lead { color: var(--muted); margin: 0 0 20px; font-size: 14px; }
label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
input[type=text], input[type=email], input[type=password] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px;
}
button.primary, a.primary {
  display: inline-block; margin-top: 20px; padding: 10px 18px; background: var(--accent);
  color: #fff; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; text-decoration: none;
}
button.primary:hover, a.primary:hover { background: var(--accent-hover); }
.alert { padding: 10px 14px; border-radius: 6px; font-size: 13px; margin-bottom: 16px; }
.alert.error { background: var(--danger-bg); color: var(--danger); }
.alert.ok { background: #e9f7ee; color: var(--ok); }
.qr { text-align: center; margin: 16px 0; }
.qr img { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: #fff; }
.secret-key { font-family: ui-monospace, Menlo, monospace; font-size: 13px; word-break: break-all; background: #f2f3f5; padding: 8px; border-radius: 6px; }
code.backup-code { display: block; font-family: ui-monospace, Menlo, monospace; font-size: 15px; padding: 6px 0; letter-spacing: .04em; }
.muted { color: var(--muted); font-size: 13px; }
.role-badge { display: inline-block; background: #eef1f6; color: var(--accent); padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.role-badge.system { background: #fff4e5; color: #8a5a00; }

/* Écrans d'administration (tableaux, formulaires en ligne, cases à cocher) */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; margin: 12px 0 24px; }
table.data th, table.data td { text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: none; }
.inline-form { display: inline; margin: 0; }
.actions-cell { white-space: nowrap; display: flex; gap: 8px; }
button.secondary, a.secondary {
  display: inline-block; padding: 6px 12px; background: #fff; color: var(--text);
  border: 1px solid var(--border); border-radius: 6px; font-size: 13px; cursor: pointer; text-decoration: none;
}
button.secondary:hover, a.secondary:hover { background: #f2f3f5; }
button.danger { background: #fff; color: var(--danger); border: 1px solid #f3c8c5; border-radius: 6px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
button.danger:hover { background: var(--danger-bg); }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 20px; margin: 10px 0 20px; }
.checkbox-grid label { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; margin: 0; font-size: 13px; cursor: pointer; }
.checkbox-grid input[type=checkbox] { margin-top: 3px; }
.checkbox-grid .perm-desc { display: block; color: var(--muted); font-size: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-top: 28px; }
.badge-count { background: #eef1f6; color: var(--muted); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.status-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.status-dot.active { background: var(--ok); }
.status-dot.inactive { background: var(--danger); }
