/* DAccE-Board — feuille de style */
:root {
  --navy: #1b2f6e;
  --navy-2: #24408f;
  --blue: #1683d8;
  --blue-soft: #e6f2fc;
  --yellow: #f5b301;
  --yellow-soft: #fff6dc;
  --green: #15994a;
  --green-soft: #e3f6ea;
  --red: #dc2648;
  --red-soft: #fde8ec;
  --orange: #e07b00;
  --bg: #f6f3ee;
  --card: #ffffff;
  --line: #e7e2d9;
  --line-2: #f0ece5;
  --text: #1f2740;
  --muted: #6b7280;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(27, 47, 110, .06), 0 2px 8px rgba(27, 47, 110, .05);
  --shadow-lg: 0 10px 30px rgba(27, 47, 110, .14);
  --sidebar: 252px;
  --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--text); background: var(--bg); }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 18px; height: 18px; flex: none; vertical-align: -3px; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
code { background: var(--line-2); padding: 1px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- Structure ---------- */
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy); color: #fff;
  display: flex; flex-direction: column; z-index: 40; transition: transform .2s ease;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 18px; color: #fff; font-size: 1.15rem; letter-spacing: .2px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; background: #fff; }
.brand b { font-weight: 800; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 6px 10px 16px; }
.sidebar nav a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; margin: 2px 0; border-radius: 9px; color: #d6def5; font-weight: 500; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; text-decoration: none; }
.sidebar nav a.active { background: #fff; color: var(--navy); font-weight: 600; }
.sidebar nav a.active .icon { color: var(--blue); }
.nav-section { margin: 18px 12px 6px; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: #8fa0d1; font-weight: 700; }
.sidebar-foot { display: flex; align-items: center; gap: 6px; padding: 12px; border-top: 1px solid rgba(255, 255, 255, .1); }
.sidebar-foot .me { flex: 1; display: flex; gap: 10px; align-items: center; color: #fff; padding: 6px; border-radius: 9px; min-width: 0; }
.sidebar-foot .me:hover, .sidebar-foot .me.active { background: rgba(255, 255, 255, .08); text-decoration: none; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text b { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #9fb0dd; font-size: .72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--yellow); color: var(--navy); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex: none; }
.sidebar .icon-btn { color: #c9d4f2; }
.sidebar .icon-btn:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.main { margin-left: var(--sidebar); min-height: 100vh; }
body.guest .main { margin-left: 0; }
.topbar { display: flex; align-items: center; gap: 14px; padding: 18px 32px 10px; }
.topbar-title { flex: 1; min-width: 0; }
.topbar h1 { font-size: 1.55rem; margin: 0; font-weight: 750; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: .85rem; color: var(--muted); margin-bottom: 2px; flex-wrap: wrap; }
.breadcrumb .icon { width: 14px; height: 14px; }
.topbar-right { display: flex; gap: 10px; align-items: center; }
.menu-btn { display: none; }
.content { padding: 12px 32px 48px; max-width: 1500px; }
.impersonation-bar { position: sticky; top: 0; z-index: 50; background: var(--yellow); color: var(--navy); display: flex; gap: 12px; align-items: center; justify-content: center; padding: 8px 16px; font-size: .9rem; flex-wrap: wrap; }
.impersonation-bar form { margin: 0; }
.has-sidebar .impersonation-bar { margin-left: var(--sidebar); }
.archive-bar { margin: 0 32px 6px; padding: 8px 14px; border-radius: 10px; background: #ece8ff; color: #3b2a8a; font-size: .9rem; display: flex; gap: 8px; align-items: center; }

/* ---------- Composants ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { margin: 0; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 20px 0; }
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack > * + * { margin-top: 12px; }
.spacer { flex: 1; }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; } .m0 { margin: 0; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.center { text-align: center; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: 9px; border: 1px solid transparent;
  background: var(--blue); color: #fff; font: inherit; font-weight: 600; cursor: pointer; line-height: 1.2; white-space: nowrap; text-decoration: none !important;
  transition: background .15s, box-shadow .15s, transform .05s;
}
.btn:hover { background: #0f6fbb; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .icon-btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(22, 131, 216, .35); outline-offset: 1px; }
.btn-navy { background: var(--navy); } .btn-navy:hover { background: var(--navy-2); }
.btn-light { background: #fff; color: var(--navy); border-color: var(--line); }
.btn-light:hover { background: var(--line-2); }
.btn-ghost { background: transparent; color: var(--navy); }
.btn-ghost:hover { background: var(--line-2); }
.btn-danger { background: var(--red); } .btn-danger:hover { background: #b81d3a; }
.btn-success { background: var(--green); } .btn-success:hover { background: #107a3a; }
.btn-warning { background: var(--yellow); color: var(--navy); } .btn-warning:hover { background: #e2a400; }
.btn-sm { padding: 6px 11px; font-size: .85rem; border-radius: 8px; }
.btn-xs { padding: 3px 8px; font-size: .78rem; border-radius: 7px; gap: 4px; }
.btn-xs .icon, .btn-sm .icon { width: 15px; height: 15px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.icon-btn { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 9px; border: 0; background: transparent; color: var(--navy); cursor: pointer; }
.icon-btn:hover { background: var(--line-2); }
.btn-group { display: inline-flex; gap: 6px; flex-wrap: wrap; }
form.inline { display: inline; margin: 0; }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 99px; background: #fff; border: 1px solid var(--line); font-size: .85rem; color: var(--navy); font-weight: 600; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: .74rem; font-weight: 700; background: var(--line-2); color: var(--navy); white-space: nowrap; vertical-align: middle; }
.badge .icon { width: 12px; height: 12px; }
.badge-blue { background: var(--blue-soft); color: #0d5f9e; }
.badge-green { background: var(--green-soft); color: #0e7a39; }
.badge-red { background: var(--red-soft); color: #b0193a; }
.badge-yellow { background: var(--yellow-soft); color: #8a6200; }
.badge-navy { background: var(--navy); color: #fff; }
.badge-purple { background: #efe9ff; color: #5b3cc4; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 10px; margin-bottom: 14px; border: 1px solid; }
.alert > div { flex: 1; }
.alert-success { background: var(--green-soft); border-color: #bfe8cf; color: #0d5e2e; }
.alert-error { background: var(--red-soft); border-color: #f7c3cf; color: #8f1530; }
.alert-warning { background: var(--yellow-soft); border-color: #f5df9b; color: #6b4d00; }
.alert-info { background: var(--blue-soft); border-color: #c4e0f7; color: #0b4f86; }
.alert-close { border: 0; background: none; cursor: pointer; color: inherit; opacity: .6; padding: 0; }
.alert-close:hover { opacity: 1; }

/* ---------- Formulaires ---------- */
label { font-weight: 600; font-size: .9rem; color: var(--navy); display: block; margin-bottom: 5px; }
.field { margin-bottom: 14px; }
.field .hint { font-size: .8rem; color: var(--muted); margin-top: 4px; font-weight: 400; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=search], input[type=file], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #d8d2c6; border-radius: 9px; font: inherit; color: var(--text); background: #fff;
}
input[type=file] { padding: 7px; background: var(--bg); }
select { padding-right: 30px; }
textarea { resize: vertical; min-height: 80px; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(22, 131, 216, .15); }
.check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); cursor: pointer; margin: 0; }
.check input { width: 17px; height: 17px; accent-color: var(--blue); margin: 0; }
.checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 6px 14px; }
.checks.scroll { max-height: 340px; overflow-y: auto; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fcfbf9; }
.form-actions { display: flex; gap: 10px; align-items: center; margin-top: 18px; flex-wrap: wrap; }
.input-group { display: flex; gap: 8px; }
.input-group > input { flex: 1; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar select, .toolbar input[type=search] { width: auto; min-width: 180px; }
.toolbar .search { position: relative; }
.toolbar .search .icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.toolbar .search input { padding-left: 34px; min-width: 240px; }
.segmented { display: inline-flex; background: #ebe6dd; padding: 3px; border-radius: 10px; gap: 2px; }
.segmented a, .segmented button { padding: 6px 12px; border-radius: 8px; color: var(--navy); font-weight: 600; font-size: .86rem; border: 0; background: none; cursor: pointer; font-family: inherit; }
.segmented a:hover { text-decoration: none; background: rgba(255,255,255,.6); }
.segmented .on { background: #fff; box-shadow: var(--shadow); }

/* ---------- Tableaux ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fbfaf7; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fcfbf8; }
.table .actions { text-align: right; white-space: nowrap; }
.table.compact td, .table.compact th { padding: 6px 10px; }
.table-sticky thead th { position: sticky; top: 0; z-index: 2; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty .icon { width: 36px; height: 36px; color: #c9c2b4; margin-bottom: 8px; }

/* ---------- Progression ---------- */
.progress { height: 8px; border-radius: 99px; background: #ece7de; overflow: hidden; min-width: 80px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: var(--blue); transition: width .3s; }
.progress.good > span { background: var(--green); }
.progress.mid > span { background: var(--yellow); }
.progress.low > span { background: var(--red); }
.progress-line { display: flex; align-items: center; gap: 10px; }
.progress-line .progress { flex: 1; }
.progress-line .pct { font-weight: 700; font-size: .85rem; min-width: 42px; text-align: right; color: var(--navy); }

.stat { padding: 18px 20px; }
.stat .label { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.stat .value { font-size: 1.9rem; font-weight: 800; color: var(--navy); line-height: 1.15; margin: 4px 0 8px; }
.stat .value small { font-size: .95rem; font-weight: 600; }

/* ---------- Tuiles (accueil) ---------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.tile { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; color: var(--text); box-shadow: var(--shadow); transition: transform .1s, box-shadow .15s, border-color .15s; }
a.tile:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow-lg); border-color: #cfe3f5; }
.tile-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
.tile-title { font-weight: 700; color: var(--navy); font-size: 1.02rem; }
.tile-sub { font-size: .85rem; color: var(--muted); }
.tile-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: .84rem; color: var(--muted); }
.hello { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.hello img { width: 64px; height: 64px; border-radius: 16px; }
.hello h2 { margin: 0; font-size: 1.35rem; }

/* ---------- Encodage ---------- */
.encode-head { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 8px 0 12px; }
.encode-list { display: flex; flex-direction: column; gap: 12px; }
.student-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; display: grid; grid-template-columns: 220px 1fr; gap: 16px; transition: border-color .2s; }
.student-card.is-required { border-left: 4px solid var(--yellow); }
.student-card.is-filled { border-left: 4px solid var(--green); }
.student-card.is-required.is-filled { border-left-color: var(--green); }
.student-id { display: flex; gap: 12px; align-items: flex-start; }
.student-id .who { min-width: 0; }
.student-id .name { font-weight: 700; color: var(--navy); display: block; line-height: 1.25; }
.student-id .meta { font-size: .8rem; color: var(--muted); }
.photo { width: 52px; height: 52px; border-radius: 12px; object-fit: cover; background: #ece7de; flex: none; display: grid; place-items: center; font-weight: 800; color: #9a917f; font-size: .9rem; }
.photo-lg { width: 150px; height: 180px; border-radius: 16px; font-size: 2.2rem; }
.photo-sm { width: 32px; height: 32px; border-radius: 8px; font-size: .7rem; }
.editor { position: relative; }
.editor textarea { min-height: 92px; padding-bottom: 26px; }
.editor-status { position: absolute; right: 10px; bottom: 8px; font-size: .75rem; color: var(--muted); display: flex; gap: 10px; align-items: center; pointer-events: none; }
.editor-status .st-saved { color: var(--green); font-weight: 600; }
.editor-status .st-saving { color: var(--blue); }
.editor-status .st-error { color: var(--red); font-weight: 700; }
.editor-status .count.over { color: var(--red); font-weight: 700; }
.readonly-text { white-space: pre-wrap; background: #faf8f4; border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; min-height: 44px; }
.readonly-text.empty-text { color: var(--muted); font-style: italic; }
details.others { margin-top: 8px; font-size: .9rem; }
details.others summary { cursor: pointer; color: var(--blue); font-weight: 600; font-size: .85rem; }
.other-comment { padding: 8px 0; border-bottom: 1px dashed var(--line); }
.other-comment:last-child { border-bottom: 0; }
.other-comment b { color: var(--navy); font-size: .85rem; }

/* ---------- Commentaires (consultation) ---------- */
.comment-block { border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; background: #fff; position: relative; }
.comment-block .cb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; flex-wrap: wrap; }
.comment-block .cb-subject { font-weight: 700; color: var(--navy); }
.comment-block .cb-author { font-size: .8rem; color: var(--muted); }
.comment-block .cb-text { white-space: pre-wrap; }
.comment-block .copy-btn { margin-left: auto; }
.comment-block.missing { background: #fbfaf7; border-style: dashed; }
.comment-block.missing .cb-text { color: var(--muted); font-style: italic; }
.comment-block.titu { background: #fffbef; border-color: #f3e2ae; }
.section-label { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 6px; }
.review-student { scroll-margin-top: 20px; }
.review-student .card-head { margin-bottom: 10px; }

/* ---------- Grilles (tableau de bord / obligatoires) ---------- */
.matrix { border-collapse: separate; border-spacing: 0; font-size: .85rem; }
.matrix th, .matrix td { border-bottom: 1px solid var(--line-2); padding: 5px 6px; text-align: center; }
.matrix th { background: #fbfaf7; font-size: .72rem; color: var(--muted); font-weight: 700; position: sticky; top: 0; z-index: 1; }
.matrix th.rot { height: 110px; vertical-align: bottom; white-space: nowrap; }
.matrix th.rot span { writing-mode: vertical-rl; transform: rotate(180deg); display: inline-block; }
.matrix td.name, .matrix th.name { text-align: left; white-space: nowrap; position: sticky; left: 0; background: #fff; z-index: 1; }
.matrix th.name { z-index: 3; background: #fbfaf7; }
.cell { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; font-size: .7rem; font-weight: 800; }
.cell .icon { width: 14px; height: 14px; }
.cell-ok { background: var(--green-soft); color: var(--green); }
.cell-miss { background: #f1eee8; color: #b3ab9b; }
.cell-req { background: var(--red-soft); color: var(--red); box-shadow: inset 0 0 0 1.5px var(--red); }
.cell-ok.req { box-shadow: inset 0 0 0 1.5px var(--green); }
.cell-na { color: #d4cec2; }
.cell-noteacher { background: #fff1db; color: var(--orange); }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: .82rem; color: var(--muted); align-items: center; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.req-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--yellow); cursor: pointer; }
.req-grid td.toggle-col, .req-grid th button { cursor: pointer; }
.req-grid th button { border: 0; background: none; color: inherit; font: inherit; padding: 0; }

.status-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; }
.status-pill .icon { width: 13px; height: 13px; }
.status-closed { background: #efece6; color: #6d6656; }
.status-open { background: var(--green-soft); color: #0e7a39; }
.status-locked { background: #ece8ff; color: #4b33ad; }

/* ---------- Profil élève ---------- */
.profile-head { display: flex; gap: 24px; align-items: flex-start; flex-wrap: wrap; }
.profile-head .info { flex: 1; min-width: 240px; }
.kv { display: grid; grid-template-columns: 160px 1fr; gap: 6px 14px; font-size: .92rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ---------- Import ---------- */
.dropzone { border: 2px dashed #cfc7b8; border-radius: 14px; padding: 28px; text-align: center; background: #fcfbf8; transition: border-color .15s, background .15s; }
.dropzone.drag { border-color: var(--blue); background: var(--blue-soft); }
.dropzone .icon { width: 40px; height: 40px; color: var(--blue); }
.step-list { counter-reset: step; list-style: none; padding: 0; margin: 0; }
.step-list li { counter-increment: step; position: relative; padding: 8px 0 8px 40px; }
.step-list li::before { content: counter(step); position: absolute; left: 0; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 800; display: grid; place-items: center; font-size: .85rem; }

/* ---------- Connexion ---------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at 20% 10%, #fff6dc 0, transparent 40%), radial-gradient(circle at 90% 90%, #e6f2fc 0, transparent 45%), var(--bg); }
.login-card { width: 100%; max-width: 410px; background: #fff; border-radius: 20px; box-shadow: var(--shadow-lg); padding: 34px 32px; border: 1px solid var(--line); }
.login-card .logo { display: block; width: 150px; height: 150px; margin: -8px auto 8px; }
.login-card h1 { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.login-card .lead { text-align: center; color: var(--muted); margin-bottom: 22px; }
.login-card .btn { width: 100%; padding: 12px; font-size: 1rem; }
.pw-wrap { position: relative; }
.pw-wrap .icon-btn { position: absolute; right: 3px; top: 50%; transform: translateY(-50%); }

/* ---------- Toast ---------- */
.toast { position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 30px); background: var(--navy); color: #fff; padding: 10px 18px; border-radius: 10px; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 100; font-weight: 600; font-size: .9rem; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

/* ---------- Divers ---------- */
.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.dl-inline { display: flex; gap: 18px; flex-wrap: wrap; font-size: .9rem; color: var(--muted); }
.dl-inline b { color: var(--navy); }
.hidden { display: none !important; }
.danger-zone { border-color: #f4c4ce; }
.danger-zone h3 { color: var(--red); }
.password-box { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.2rem; background: var(--yellow-soft); border: 1px dashed var(--yellow); padding: 10px 14px; border-radius: 10px; display: inline-block; letter-spacing: .5px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs a { padding: 9px 14px; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--navy); text-decoration: none; }
.tabs a.on { color: var(--navy); border-bottom-color: var(--blue); }
.sticky-actions { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 30%); padding: 18px 0 8px; z-index: 5; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  body.sidebar-open .sidebar { transform: none; }
  body.sidebar-open .sidebar-backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .35); z-index: 30; }
  .main, .has-sidebar .impersonation-bar { margin-left: 0; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px 6px; }
  .topbar h1 { font-size: 1.25rem; }
  .content { padding: 10px 16px 40px; }
  .archive-bar { margin: 0 16px 6px; }
  .student-card { grid-template-columns: 1fr; gap: 10px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .toolbar .search input { min-width: 0; }
  .toolbar select, .toolbar input[type=search] { min-width: 0; width: 100%; }
  .toolbar > * { flex: 1 1 100%; }
}

/* ---------- Impression ---------- */
@media print {
  .sidebar, .topbar, .toolbar, .btn, .icon-btn, .impersonation-bar, .archive-bar, .alert, .no-print { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; font-size: 11pt; }
  .card { box-shadow: none; border: 0; padding: 0; }
  .review-student { page-break-after: always; }
}
.step-list li.row > span:first-child { flex: 1; min-width: 200px; }

/* ---------- Menu compact + groupe déroulant ---------- */
:root { --sidebar: 236px; }
.brand { padding: 12px 16px; font-size: 1.05rem; }
.brand img { border-radius: 9px; }
.sidebar nav { padding: 4px 8px 12px; }
.sidebar nav a { padding: 7px 10px; margin: 1px 0; gap: 10px; font-size: .9rem; border-radius: 8px; }
.nav-section { margin: 12px 10px 4px; font-size: .68rem; }
.nav-group { margin-top: 10px; }
.nav-group summary { list-style: none; display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; cursor: pointer;
  color: #d6def5; font-weight: 600; font-size: .9rem; user-select: none; }
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-group summary span { flex: 1; }
.nav-group .nav-caret { width: 15px; height: 15px; transition: transform .15s; opacity: .7; }
.nav-group[open] .nav-caret { transform: rotate(90deg); }
.nav-group[open] summary { color: #fff; }
.nav-group-items { margin: 2px 0 0 12px; padding-left: 6px; border-left: 1px solid rgba(255, 255, 255, .14); }
.nav-group-items a { font-size: .86rem !important; padding: 6px 10px !important; }
.nav-group-items a .icon { width: 16px; height: 16px; }
.sidebar-foot { padding: 8px 10px; }
.avatar { width: 30px; height: 30px; font-size: .74rem; }
@media (max-height: 760px) {
  .brand { padding: 9px 14px; }
  .brand img { width: 30px; height: 30px; }
  .sidebar nav a, .nav-group summary { padding: 5px 10px; }
  .nav-section { margin: 8px 10px 2px; }
  .me-text small { display: none; }
}
@media (max-width: 900px) {
  .sidebar { width: min(280px, 85vw); }
}
.grid-side { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
@media (max-width: 1200px) { .grid-side { grid-template-columns: 1fr; } }
