/* Mes Cours - Sup'ISI : habillage au-dessus de Bootstrap 4.6 */
:root {
    --ink: #15171b;
    --ink-2: #23262d;
    --orange: #ffa500;
    --orange-d: #d98a00;
    --paper: #f6f4ef;
    --card: #ffffff;
    --line: #e5e0d5;
    --muted: #6d7078;
}

html { -webkit-text-size-adjust: 100%; }
body {
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
a { color: var(--ink); }
a:hover { color: var(--orange-d); }
.sp-main { flex: 1 0 auto; padding-top: 28px; padding-bottom: 48px; }

/* ----- En-tête ----- */
.sp-top { background: #fff; border-bottom: 1px solid var(--line); padding: 10px 0; }
.sp-brand img { height: 46px; width: auto; display: block; }
.sp-year { text-align: right; font-size: .9rem; line-height: 1.2; color: var(--muted); }
.sp-year strong { color: var(--ink); font-size: 1rem; }
.sp-year-label { display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.sp-group {
    display: inline-block; margin-left: 6px; padding: 1px 9px;
    background: var(--orange); color: var(--ink); font-weight: 700; border-radius: 20px; font-size: .8rem;
}

/* ----- Bandeau titre ----- */
.sp-hero {
    background: var(--ink);
    color: #fff;
    padding: 44px 0 40px;
    position: relative;
    border-bottom: 5px solid var(--orange);
}
.sp-hero-course { padding: 22px 0 30px; }
.sp-h1 {
    font-family: Oswald, "Arial Narrow", Impact, sans-serif;
    font-weight: 600; text-transform: uppercase; letter-spacing: .02em;
    font-size: 2.9rem; line-height: 1.05; margin: 0;
}
.sp-hero-course .sp-h1 { font-size: 2.1rem; }
.sp-h1 em { font-style: normal; color: var(--orange); }
.sp-sub { margin: 10px 0 0; color: #c9ccd3; font-size: 1.05rem; }
.sp-hero-course .sp-sub { margin-top: 6px; font-size: .98rem; }
.sp-hero-logo {
    background: #fff; border-radius: 12px; padding: 8px; margin-right: 18px;
    width: 84px; height: 84px; display: flex; align-items: center; justify-content: center; flex: none;
}
.sp-hero-logo img { max-width: 100%; max-height: 100%; }
.sp-crumb { background: none; padding: 0; margin: 0 0 14px; font-size: .88rem; }
.sp-crumb a { color: var(--orange); }
.sp-crumb .breadcrumb-item.active { color: #c9ccd3; }
.sp-crumb .breadcrumb-item + .breadcrumb-item::before { color: #7d818a; }

/* ----- Cartes de cours (accueil) ----- */
.sp-section-title {
    font-family: Oswald, "Arial Narrow", sans-serif; text-transform: uppercase;
    letter-spacing: .06em; font-size: 1rem; color: var(--muted); margin: 0 0 16px;
}
.sp-course {
    display: flex; align-items: center; height: 100%;
    background: var(--card); border: 1px solid var(--line); border-left: 5px solid var(--line);
    border-radius: 10px; padding: 18px 20px; text-decoration: none !important; color: var(--ink);
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.sp-course:hover {
    transform: translateY(-3px); border-left-color: var(--orange);
    box-shadow: 0 10px 24px rgba(21,23,27,.10); color: var(--ink);
}
.sp-course-ico {
    flex: none; width: 72px; height: 72px; border-radius: 10px; background: var(--paper);
    display: flex; align-items: center; justify-content: center; margin-right: 18px; overflow: hidden;
}
.sp-course-ico img { max-width: 80%; max-height: 80%; }
.sp-course-ico span {
    font-family: Oswald, "Arial Narrow", sans-serif; font-weight: 700; font-size: 1.5rem; color: var(--ink);
}
.sp-course-body { flex: 1; min-width: 0; }
.sp-course-title { font-size: 1.2rem; font-weight: 700; line-height: 1.2; margin: 0; }
.sp-course-sub { color: var(--muted); font-size: .92rem; margin: 2px 0 8px; }
.sp-course-meta { font-size: .8rem; color: var(--muted); }
.sp-course-meta b { color: var(--ink); }
.sp-arrow { flex: none; font-size: 1.6rem; color: var(--line); margin-left: 12px; transition: color .15s, transform .15s; }
.sp-course:hover .sp-arrow { color: var(--orange); transform: translateX(3px); }

/* ----- Accès (clé) ----- */
.sp-gate {
    max-width: 400px; margin: 0 auto; background: var(--card); border: 1px solid var(--line);
    border-top: 5px solid var(--orange); border-radius: 12px; padding: 28px;
    box-shadow: 0 12px 30px rgba(21,23,27,.08);
}
.sp-gate h2 { font-family: Oswald, sans-serif; text-transform: uppercase; font-size: 1.4rem; margin: 0 0 4px; }
.sp-gate p { color: var(--muted); font-size: .92rem; }
.form-control:focus, .custom-select:focus {
    border-color: var(--orange); box-shadow: 0 0 0 .2rem rgba(255,165,0,.25);
}
.btn-sp { background: var(--ink); color: #fff; font-weight: 600; border: 0; border-radius: 8px; padding: 10px 18px; }
.btn-sp:hover, .btn-sp:focus { background: var(--orange); color: var(--ink); }
.sp-lock { font-size: .85rem; color: var(--muted); }

/* ----- Barre d'outils + filtres ----- */
.sp-toolbar { margin-bottom: 18px; }
.sp-chips { display: flex; flex-wrap: wrap; margin: 0 -4px 14px; }
.sp-chip {
    margin: 4px; padding: 6px 14px; border-radius: 20px; border: 1px solid var(--line);
    background: #fff; color: var(--ink); font-size: .9rem; font-weight: 600; cursor: pointer;
}
.sp-chip span { margin-left: 4px; color: var(--muted); font-weight: 500; }
.sp-chip:hover { border-color: var(--ink); }
.sp-chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.sp-chip.active span { color: var(--orange); }
.sp-tools { max-width: 560px; }
.sp-tools .form-control, .sp-tools .custom-select { border-radius: 8px; border-color: var(--line); }

/* ----- Liste de fichiers ----- */
.sp-files { list-style: none; margin: 0; padding: 0; }
.sp-file {
    display: flex; align-items: center; background: var(--card); border: 1px solid var(--line);
    border-radius: 10px; padding: 12px 14px; margin-bottom: 10px;
    transition: box-shadow .15s ease, border-color .15s ease;
}
.sp-file:hover { border-color: #cfc8b8; box-shadow: 0 6px 16px rgba(21,23,27,.07); }
.sp-ext {
    flex: none; width: 50px; height: 50px; border-radius: 8px; margin-right: 14px;
    display: flex; align-items: center; justify-content: center;
    background: #6d7078; color: #fff; font-size: .72rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .04em;
}
.sp-ext-pdf { background: #c0392b; }
.sp-ext-rar, .sp-ext-zip, .sp-ext-7z { background: #7a4fb0; }
.sp-ext-exe, .sp-ext-msi { background: #1d7a8c; }
.sp-ext-doc, .sp-ext-docx { background: #2b5fb4; }
.sp-ext-xls, .sp-ext-xlsx { background: #2e8b57; }
.sp-ext-ppt, .sp-ext-pptx { background: #d35a1f; }
.sp-ext-mp4 { background: #333; }
.sp-file-main { flex: 1; min-width: 0; text-decoration: none !important; display: block; }
.sp-file-name { display: block; font-weight: 600; word-break: break-word; line-height: 1.25; }
.sp-file-main:hover .sp-file-name { color: var(--orange-d); }
.sp-file-meta { display: block; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.sp-tag {
    flex: none; margin: 0 12px; padding: 3px 11px; border-radius: 20px; font-size: .75rem; font-weight: 700;
    background: #ececec; color: #444;
}
.sp-tag-tp       { background: #fff1d1; color: #8a5a00; }
.sp-tag-solution { background: #dff3e6; color: #1b6b3a; }
.sp-tag-source   { background: #e1ebfb; color: #234f9c; }
.sp-tag-cours    { background: #ece4f6; color: #5a3a8a; }
.sp-tag-examen   { background: #fbe2df; color: #a02a1e; }
.sp-tag-logiciel { background: #dcf0f3; color: #176473; }
.sp-tag-outils   { background: #e4eef0; color: #2f5b66; }
.sp-dl {
    flex: none; border: 1px solid var(--ink); color: var(--ink); background: transparent;
    border-radius: 8px; font-weight: 600; padding: 6px 14px;
}
.sp-dl:hover { background: var(--ink); color: #fff; }
.sp-count { margin-top: 18px; font-size: .85rem; color: var(--muted); }
.sp-empty {
    padding: 36px; text-align: center; color: var(--muted); background: var(--card);
    border: 1px dashed var(--line); border-radius: 10px;
}

/* ----- Pied de page ----- */
.sp-footer { flex-shrink: 0; background: var(--ink); color: #9a9ea7; font-size: .85rem; padding: 16px 0; text-align: center; }

/* ----- Mobile ----- */
@media (max-width: 767.98px) {
    .sp-h1 { font-size: 2.1rem; }
    .sp-hero-course .sp-h1 { font-size: 1.6rem; }
    .sp-brand img { height: 36px; }
    .sp-file { flex-wrap: wrap; }
    .sp-file-main { flex: 1 1 calc(100% - 70px); }
    .sp-tag { margin: 10px 0 0 64px; }
    .sp-dl { margin: 10px 0 0 auto; }
    .sp-course-ico { width: 58px; height: 58px; margin-right: 14px; }
}
@media print {
    .sp-toolbar, .sp-dl, .sp-footer { display: none; }
}

/* ----- Administration ----- */
.sp-admin-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 12px;
    padding: 22px; margin-bottom: 20px;
}
.sp-admin-gtitle {
    font-family: Oswald, "Arial Narrow", sans-serif; text-transform: uppercase; letter-spacing: .04em;
    font-size: 1.05rem; margin: 0 0 14px;
}
.sp-admin-gtitle span {
    background: var(--ink); color: var(--orange); border-radius: 20px; padding: 1px 9px;
    font-size: .8rem; margin-left: 6px; vertical-align: middle;
}
.sp-admin-group .sp-file { margin-bottom: 8px; }
.sp-drop {
    position: relative; border: 2px dashed #cfc8b8; border-radius: 12px; background: var(--paper);
    text-align: center; padding: 34px 16px; transition: border-color .15s, background .15s;
}
.sp-drop.over, .sp-drop:hover { border-color: var(--orange); background: #fff8e8; }
.sp-drop input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.sp-drop-hint { color: var(--muted); font-size: .85rem; margin-top: 4px; }
.sp-picked { list-style: none; margin: 12px 0; padding: 0; font-size: .9rem; color: var(--ink-2); }
.sp-picked li { padding: 3px 0; border-bottom: 1px solid var(--line); }
.sp-progress { height: 22px; margin: 14px 0; border-radius: 8px; }
.sp-progress .progress-bar { background: var(--orange); color: var(--ink); font-weight: 700; }
.sp-limits { margin: 12px 0 0; font-size: .82rem; color: var(--muted); }
.sp-rm { flex: none; border: 1px solid #c0392b; color: #c0392b; background: transparent; border-radius: 8px; font-weight: 600; padding: 6px 14px; }
.sp-rm:hover { background: #c0392b; color: #fff; }
@media (max-width: 767.98px) { .sp-del { margin: 10px 0 0 auto !important; } }

/* ----- Statut « terminé » ----- */
.sp-file.is-done { border-left: 4px solid #2e8b57; }
.sp-tag-done { background: #2e8b57; color: #fff; white-space: nowrap; }
.sp-chip-done.active { background: #2e8b57; border-color: #2e8b57; }
.sp-chip-done.active span { color: #fff; }
.sp-done-btn {
    flex: none; margin-right: 8px; border: 1px solid #2e8b57; color: #2e8b57; background: transparent;
    border-radius: 8px; font-weight: 600; padding: 6px 14px; white-space: nowrap;
}
.sp-done-btn:hover { background: #2e8b57; color: #fff; }
.sp-done-btn.on { background: #2e8b57; color: #fff; }
.sp-done-btn.on:hover { background: transparent; color: #2e8b57; }
@media (max-width: 767.98px) { .sp-tag-done { margin-top: 10px; } .sp-admin-group .sp-file form { margin-top: 10px !important; } }

/* Page « Notes des TP » */
.sp-notes { border: 1px solid #e5e1d8; border-radius: 10px; overflow: hidden; }
.sp-notes th { background: #f4f2ec; font-weight: 600; border-top: 0; }

/* Documents masqués au public (vus par l'administrateur) */
.sp-tag-hidden { background: #eceaf0; color: #55506a; white-space: nowrap; }
.sp-hide-btn { border: 1px solid #8a8697; color: #55506a; background: #fff; }
.sp-hide-btn:hover, .sp-hide-btn.on { background: #55506a; color: #fff; }
.sp-file.is-hidden { opacity: .72; border-style: dashed; }
