/* ==========================================================================
   Admin USRS – composants propres à l'admin, sur le design system des cours (app.css)
   ========================================================================== */

/* Navigation latérale */
.adm-nav { padding-top: 8px; }
.adm-nav .les { padding-top: 9px; padding-bottom: 9px; }
.adm-nav .les .n { font-size: 16px; width: 20px; }
.adm-nav .les .n i { font-size: 17px; }
.adm-nav .les b { display: block; font: 500 12px var(--mono); letter-spacing: .06em; }
.adm-nav .les small { display: block; color: var(--muted); font-size: 12.5px; }
.adm-nav-title { display: block; color: var(--muted); padding: 22px 16px 8px; }
.adm-code { font: 500 11px var(--mono); letter-spacing: .08em; color: var(--red); }

/* Liens et notes */
.prose a.adm-link:not(.btn):not(.link-arrow) { color: var(--ink); text-decoration: none; }
.prose a.adm-link:not(.btn):not(.link-arrow):hover { color: var(--red); }
.adm-note { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.adm-note i { font-size: 16px; margin-top: 2px; flex: none; }
.adm-hint { display: flex; align-items: center; gap: 14px; margin-bottom: 20px; padding: 16px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--warn-soft); color: var(--ink-2); font-size: 15px; line-height: 1.45; transition: border-color .15s; }
.prose a.adm-hint:not(.btn):not(.link-arrow) { text-decoration: none; color: var(--ink-2); }
.adm-hint:hover { border-color: var(--warn); }
.adm-hint b { color: var(--ink); font-weight: 500; }
.adm-hint > i:first-child { font-size: 20px; color: var(--warn); flex: none; }
.adm-hint > i:last-child { margin-left: auto; color: var(--muted); }

/* Cartes de cours */
.adm-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 32px; }
.adm-card { display: flex; flex-direction: column; gap: 18px; padding: 26px 28px; min-height: 300px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--panel-2); transition: border-color .2s; }
.adm-card:hover { border-color: var(--red-line); }
.adm-card header { display: flex; align-items: center; justify-content: space-between; }
.adm-card header .adm-code { padding: 5px 10px; border-radius: 999px; background: var(--red-soft); font-size: 12px; }
.adm-card header .ibtn { width: 36px; height: 36px; font-size: 16px; }
.prose .adm-card h3 { margin: 0; font-size: 22px; font-weight: 500; line-height: 1.25; letter-spacing: -.02em; color: var(--ink); }
.adm-card dl { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: auto 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.adm-card dl > div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; min-width: 0; }
.adm-card dl > div + div { padding-left: 14px; border-left: 1px solid var(--line); }
.adm-card .adm-na { color: var(--muted); }
.adm-card dt { color: var(--muted); font-size: 10.5px; letter-spacing: .1em; }
.adm-card dd { margin: 0; font-size: 40px; font-weight: 500; letter-spacing: -.03em; color: var(--ink); line-height: 1; white-space: nowrap; }
.adm-card dd small { font-size: 16px; letter-spacing: 0; color: var(--muted); font-weight: 400; }
.adm-card dd .status { font-size: 14px; letter-spacing: 0; }
.adm-card .link-arrow { font-size: 15px; padding-top: 16px; border-top: 1px solid var(--line); }
.adm-card .adm-muted { color: var(--muted); }
.adm-card.off { background: var(--panel); border-style: dashed; }
.adm-off { display: flex; align-items: center; gap: 10px; margin: auto 0 0; color: var(--muted); font-size: 15px; }
.adm-off i { font-size: 20px; }
.adm-progress { display: flex; flex-direction: column; gap: 8px; }
.adm-progress > div { display: flex; justify-content: space-between; color: var(--muted); }
.adm-progress b { font: 500 12px var(--mono); color: var(--ink-2); }
.adm-bar { height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; }
.adm-bar i { display: block; height: 100%; background: var(--ok); border-radius: 6px; }
@media (max-width: 1280px) { .adm-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .adm-cards { grid-template-columns: minmax(0, 1fr); } .adm-card { min-height: 0; } }

/* Import */
.adm-import { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.adm-import .btn { margin-left: auto; }
.adm-file { position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px dashed var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--ink-2); font-size: 14px; cursor: pointer; transition: border-color .15s; max-width: 280px; }
.adm-file:hover, .adm-file:focus-within { border-color: var(--red); }
.adm-file i { font-size: 18px; color: var(--red); }
.adm-file span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.adm-targets { display: flex; align-items: center; gap: 14px; border: 0; padding: 0; margin: 0; }
.adm-targets legend { float: left; color: var(--muted); margin-right: 4px; }
.adm-targets .check, .adm-toggle { margin: 0; font-family: var(--mono); font-size: 12.5px; }
.adm-targets .check.off { opacity: .45; cursor: not-allowed; }
.admin-add .adm-note { margin-top: 14px; }
.adm-reset-targets { margin: 0 0 16px; flex-wrap: wrap; }
.adm-muted { color: var(--muted); }
.admin-reset p b { color: var(--ink); font-weight: 500; }

/* Tableaux */
.admin-list .status.ko { color: var(--warn); }
.adm-cell { white-space: nowrap; }
.adm-item { white-space: normal !important; min-width: 280px; max-width: 460px; text-align: left !important; font-family: var(--sans); font-size: 14px; line-height: 1.4; }
.adm-type { display: inline-block; padding: 2px 8px; border-radius: 999px; font: 500 11px var(--mono); letter-spacing: .04em; background: var(--line-2); color: var(--ink-2); }
.adm-type.t-code { background: var(--red-soft); color: var(--red); }
.adm-type.t-video, .adm-type.t-peer { background: var(--ok-soft); color: var(--ok); }
.adm-type.t-memory, .adm-type.t-answer { background: var(--warn-soft); color: var(--warn); }
.adm-score { font: 600 13px var(--mono); }
.adm-score small { font-weight: 400; color: var(--muted); }
.adm-score .ok { color: var(--ok); }
.adm-score .mid { color: var(--warn); }
.adm-score .ko { color: var(--ko); }
.adm-score .muted { color: var(--muted); font-weight: 400; }
.admin-list .admin-actions .ibtn { display: inline-grid; }

/* Notes */
.adm-grades th small { display: block; font-weight: 400; color: var(--muted); letter-spacing: .04em; text-transform: none; }
.adm-grades th { white-space: normal !important; min-width: 90px; vertical-align: bottom; }
.adm-grades td.adm-score { text-align: center; }
.adm-grades .total { background: var(--red-soft); }

/* Filtres */
.adm-filters { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.adm-filters .field { flex: 1; min-width: 200px; max-width: 360px; margin: 0; }
.adm-seg { display: inline-flex; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel-2); }
.prose .adm-seg a:not(.btn):not(.link-arrow) { padding: 7px 12px; border-radius: 10px; font: 500 12px var(--mono); letter-spacing: .06em; color: var(--muted); text-decoration: none; }
.prose .adm-seg a:not(.btn):not(.link-arrow):hover { color: var(--ink); }
.prose .adm-seg a.on:not(.btn):not(.link-arrow) { background: var(--panel); color: var(--red); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.adm-select { display: inline-flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); color: var(--muted); }
.adm-select select { border: 0; outline: none; background: none; color: var(--ink); font: 400 14px var(--sans); padding: 11px 0; cursor: pointer; }
.adm-select select option { background: var(--panel); }

/* Détail d'un rendu */
.adm-sub { margin-bottom: 16px; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.adm-sub header { display: flex; align-items: center; gap: 14px; padding: 12px 16px; background: var(--panel-2); border-bottom: 1px solid var(--line); }
.adm-sub header b { font-weight: 500; color: var(--ink); }
.adm-sub header .link-arrow { margin-left: auto; font-size: 14px; }
.adm-sub header .adm-score { margin-left: auto; }
.prose .adm-code-block { margin: 0; padding: 16px 18px; max-height: 60vh; overflow: auto; background: var(--code); color: var(--code-txt); font: 400 13px/1.6 var(--mono); tab-size: 4; }
.adm-code-block code { background: none; color: inherit; padding: 0; font: inherit; white-space: pre; }
.adm-text { padding: 16px 18px; white-space: pre-wrap; font-size: 15px; color: var(--ink-2); }

@media (max-width: 760px) {
  .adm-import .btn { margin-left: 0; width: 100%; justify-content: space-between; }
  .adm-targets { flex-wrap: wrap; }
  .adm-filters .field { max-width: none; }
}
