/* EVM – Pages de compte, d’administration et d’installation */
.auth-body { min-height: 100vh; display: flex; flex-direction: column; }
.auth-body main { flex: 1; }
.auth-wrap { width: min(440px, 100%); margin: 28px auto; padding: 0 16px; }
.auth-wrap.wide { width: min(760px, 100%); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 22px; box-shadow: 0 2px 10px rgba(16, 24, 40, .04); }
.card + .card { margin-top: 16px; }
.card h1 { margin: 0 0 14px; font-size: 1.35rem; color: var(--blue); }
.card h2 { margin: 18px 0 10px; font-size: 1.02rem; }
.card .lead { color: var(--muted); margin: -6px 0 16px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.field textarea { font: inherit; font-weight: 400; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; min-height: 90px; resize: vertical; }
.alert { border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: .94rem; border: 1px solid; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert.ok { background: #eef8e6; border-color: #b6dd95; color: #2f5d0f; }
.alert.ko { background: #fdecef; border-color: #f1aab8; color: #8d1b31; }
.alert.warn { background: #fff7e0; border-color: #f3d98a; color: #6b4e00; }
.alert.info { background: #e8f2fb; border-color: #a9cdee; color: #0b4a7a; }
.checks { list-style: none; padding: 0; margin: 0 0 14px; }
.checks li { padding: 4px 0; }
.checks li.ok { color: #2f6f0f; } .checks li.ko { color: #b0203f; font-weight: 700; } .checks li.warn { color: #8a6500; }
.auth-links { text-align: center; margin-top: 14px; font-size: .92rem; }
.auth-links a { color: var(--blue); font-weight: 700; }
.code-box { font-family: ui-monospace, Consolas, monospace; font-size: 1.15rem; font-weight: 700; background: #f3f6fb; border: 1px dashed var(--blue); border-radius: 8px; padding: 10px; text-align: center; letter-spacing: .5px; margin: 10px 0; user-select: all; }

/* Barre de navigation des pages connectées */
.topnav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.topnav a, .topnav button { text-decoration: none; color: var(--ink); font-weight: 700; font-size: .9rem; padding: 7px 11px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.topnav a:hover, .topnav button:hover { background: #eef3fa; color: var(--blue); }
.topnav a.active { background: var(--blue); color: #fff; }
.topnav .me { display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; border: 2px solid var(--line); background: #fff; }
.avatar.big { width: 96px; height: 96px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 800; white-space: nowrap; }
.badge.actif { background: #e3f4d6; color: #2f6f0f; } .badge.en_attente { background: #fff1c9; color: #7a5a00; }
.badge.desactive { background: #eceff3; color: #555; } .badge.refuse { background: #fde0e6; color: #9b1c36; }
.badge.superadmin { background: #fde6dc; color: #9a3a0b; } .badge.admin { background: #e1edfb; color: #0b4a7a; } .badge.enseignant { background: #eef0f4; color: #3a4252; }

/* Tableau de bord */
.page { max-width: 1200px; margin: 0 auto; padding: 20px 16px; width: 100%; }
.page h1 { margin: 0 0 16px; font-size: 1.4rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.6rem; color: var(--blue); }
.stat span { color: var(--muted); font-size: .88rem; }
.stat.attn b { color: var(--orange); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 12px; }
.filters .field { margin: 0; flex: 0 1 200px; }
.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { background: #f6f8fb; font-size: .82rem; text-transform: uppercase; letter-spacing: .3px; color: var(--muted); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.actions { white-space: nowrap; text-align: right; }
.inline { display: inline; }
.btn.sm { padding: 5px 10px; font-size: .82rem; }
.btn.danger { background: #fff; border-color: #e6a3b1; color: #b0203f; }
.btn.danger:hover:not(:disabled) { background: #b0203f; border-color: #b0203f; color: #fff; }
.btn.ok { background: var(--green); border-color: var(--green); color: #fff; }
.muted { color: var(--muted); }
.empty-row { text-align: center; color: var(--muted); padding: 26px !important; }
.pager { display: flex; gap: 6px; justify-content: center; margin: 14px 0; flex-wrap: wrap; }
.pager a, .pager span { padding: 6px 11px; border-radius: 8px; border: 1px solid var(--line); background: #fff; text-decoration: none; color: var(--ink); font-weight: 700; font-size: .88rem; }
.pager span.cur { background: var(--blue); color: #fff; border-color: var(--blue); }
.profile-head { display: flex; gap: 16px; align-items: center; margin-bottom: 14px; }
.kv { display: grid; grid-template-columns: 170px 1fr; gap: 6px 12px; font-size: .94rem; }
.kv dt { color: var(--muted); font-weight: 700; }
.kv dd { margin: 0; }
.site-head .brand { gap: 14px; }
@media (max-width: 700px) {
  .grid2 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .topnav { width: 100%; justify-content: flex-start; }
}
.flash-wrap { padding-bottom: 0; }
.auth-wrap .flash-wrap, .flash-wrap + .auth-wrap { margin-top: 12px; }
.pin-field { position: relative; }
.pin-field input { padding-right: 70px; }
.pin-toggle { position: absolute; right: 6px; bottom: 6px; border: 0; background: #eef3fa; color: var(--blue); font-weight: 700; font-size: .78rem; border-radius: 6px; padding: 4px 8px; cursor: pointer; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
@media print {
  body:not(.is-printing) .flash-wrap, body:not(.is-printing) .topnav { display: none !important; }
}
body.gen .layout { width: 100%; }
.brand .avatar { height: 34px; width: 34px; }
.who { display: flex; gap: 10px; align-items: center; }
.who .avatar { flex: none; }
td.actions form, td.actions a { margin: 2px 0; }
td.actions .btn { text-decoration: none; display: inline-block; }
.section-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 22px 0 10px; flex-wrap: wrap; }
.section-title h2 { margin: 0; font-size: 1.1rem; }
a.btn { text-decoration: none; display: inline-block; }

/* Étape 4 : enregistrement des sujets, profil */
.save-err { color: #8d1b31; background: #fdecef; border: 1px solid #f1aab8; border-radius: 8px; padding: 8px 12px; margin: 8px 0 0; font-size: .9rem; }
.sujet-banner { padding-bottom: 0; }
.sujet-banner .alert { margin: 12px 0 0; }
.photo-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.photo-form .field { flex: 1 1 280px; margin: 0; }
td.actions form.inline { display: inline-block; margin: 2px 0; }
@media print { .sujet-banner { display: none !important; } }
.grid2 { align-items: end; }
