/* ============================================================
   LabUP — charte graphique AdaptUP
   Vert #00CE75, encre #191716, fond crème #F9F7F5, police Sora.
   ============================================================ */
/* Les couleurs, rayons et ombres sont dans static/css/jetons.css,
   chargee avant cette feuille. Ne pas redefinir de valeur ici. */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Sora', system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    color: var(--ink);
    background: var(--bg);
    line-height: 1.55;
}

.container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
}

/* --- En-tête --- */
/* Hauteur du bandeau : le remplissage vertical est a zero, c'est la
   hauteur minimale de .header-inner qui commande seule, sinon les deux
   s'additionnent. UNE seule valeur a changer, celle de min-height. */
.site-header {
    background: var(--ink);
    padding: 0;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0.3px;
}

.brand span { color: var(--green); }

.nav {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    flex-wrap: wrap;
}

.nav-user { color: #b9b6b0; font-size: 0.9rem; }

.nav-link { color: #ece9e4; text-decoration: none; font-size: 0.95rem; }
.nav-link:hover { color: #fff; text-decoration: underline; }

/* --- Boutons --- */
.btn {
    display: inline-block;
    background: var(--green);
    color: var(--ink);
    padding: 0.65rem 1.3rem;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    border: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
}

.btn:hover { background: var(--green-dark); }
.btn:active { transform: translateY(1px); }
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.9rem; }

.btn-outline {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--green);
}

.btn-outline:hover { background: var(--green-lt); }

/* --- Hero --- */
.hero { padding: 3.5rem 0 2.5rem; }
.hero-sm { padding: 2rem 0 1.25rem; }

.hero h1 {
    font-size: 2.6rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    color: var(--ink);
    line-height: 1.15;
}

.lead {
    font-size: 1.2rem;
    color: var(--muted);
    max-width: 48ch;
}

.hero-actions { margin-top: 1.75rem; display: flex; gap: 0.75rem; flex-wrap: wrap; }

.status {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.4rem 1rem;
    background: var(--green-lt);
    color: var(--green-dark);
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
}

/* --- Cartes de modules --- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.1rem;
    margin: 1.5rem 0 3rem;
}

.card {
    display: block;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10);
    transform: translateY(-3px);
    border-color: var(--green);
}

.card h3 { margin: 0 0 0.4rem; color: var(--ink); font-weight: 600; }
.card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.badge {
    display: inline-block;
    margin-top: 0.7rem;
    padding: 0.15rem 0.7rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
}

/* --- États et notices --- */
.empty-state { padding: 2rem 0; }
.muted { color: var(--muted); }

.notice { border-radius: 14px; padding: 1rem 1.25rem; margin: 1rem 0; }
.notice-warning { background: var(--orange-lt); border: 1px solid #ffd98a; }
.notice-danger { background: var(--red-lt); border: 1px solid #ffc4c2; }

.message {
    border-radius: 12px;
    padding: 0.7rem 1rem;
    margin: 0.5rem 0;
    background: var(--green-lt);
    border: 1px solid var(--green-soft);
}

.message-error, .message-danger { background: var(--red-lt); border-color: #ffc4c2; }
.message-success { background: var(--green-lt); border-color: var(--green-soft); }

/* --- Pages de compte (allauth) --- */
.auth-wrap { display: flex; justify-content: center; padding: 2.5rem 1.25rem; }

.auth-card {
    width: 100%;
    max-width: 430px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 2rem;
    box-shadow: var(--shadow-card);
}

.auth-card h1 { font-size: 1.5rem; margin: 0 0 1rem; color: var(--ink); font-weight: 700; }
.auth-card form { display: block; }

.auth-card label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin: 0.85rem 0 0.25rem;
}

.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="text"] {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg);
}

.auth-card input:focus {
    outline: none;
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 206, 117, 0.15);
}

.auth-card button[type="submit"] {
    width: 100%;
    margin-top: 1.3rem;
    background: var(--green);
    color: var(--ink);
    padding: 0.75rem 1rem;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
}

.auth-card button[type="submit"]:hover { background: var(--green-dark); }
.auth-card a { color: var(--green-dark); }
.auth-card ul { padding-left: 1.1rem; color: var(--muted); font-size: 0.9rem; }
.auth-card .helptext { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.25rem; }
.auth-card .errorlist { color: var(--red); list-style: none; padding: 0; font-size: 0.9rem; }

/* --- Tableau de bord établissement --- */
h2 { color: var(--ink); margin-top: 2rem; font-weight: 600; }

.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    margin: 0.75rem 0 1.5rem;
}

.table th, .table td {
    text-align: left;
    padding: 0.7rem 1rem;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
}

.table th { background: var(--green-lt); font-size: 0.8rem; color: var(--green-dark); text-transform: uppercase; letter-spacing: 0.03em; }
.table tbody tr:last-child td { border-bottom: none; }
.table-actions { text-align: right; }

.panel {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    padding: 1.5rem;
    margin: 0 0 1.5rem;
    box-shadow: var(--shadow-card);
}

.panel h3 { margin: 0 0 0.25rem; color: var(--ink); font-weight: 600; }

.inline-form { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin-top: 0.85rem; }

.inline-form input[type="email"],
.inline-form select {
    padding: 0.55rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-input);
    font-size: 0.95rem;
    font-family: inherit;
    background: var(--bg);
}

.inline-form input[type="email"] { min-width: 240px; flex: 1; }

.btn-link-danger {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 0.9rem;
    font-family: inherit;
    padding: 0;
    text-decoration: underline;
}

.nav-link-back { color: var(--green-dark); text-decoration: none; font-size: 0.95rem; }
.nav-link-back:hover { text-decoration: underline; }

/* --- Pages légales --- */
.legal { max-width: 720px; padding: 2rem 0 3rem; }
.legal h1 { color: var(--ink); font-weight: 700; }
.legal h2 { font-size: 1.15rem; margin-top: 1.75rem; }
.legal h3 { font-size: 1rem; font-weight: 700; margin-top: 1.4rem; margin-bottom: .35rem; }
.legal p { color: #33302c; }
.legal a { color: var(--green-dark); }

/* --- Pied de page --- */
.site-footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
    color: var(--muted);
    font-size: 0.9rem;
}

.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem; }
.footer-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* --- BibliUP : bibliothèque d'aides techniques --- */
.bib-search { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; margin: 0 0 1rem; }
.bib-search input[type="search"] {
    flex: 1; min-width: 220px; padding: 0.65rem 1.1rem;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    font: inherit; background: var(--white);
}
.bib-search input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 206, 117, 0.15); }
.bib-filtres { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0 0 1.25rem; }
.bib-pill {
    display: inline-flex; align-items: center; gap: 0.35rem;
    padding: 0.35rem 0.85rem; border-radius: var(--radius-pill);
    border: 1.5px solid var(--border); background: var(--white);
    color: var(--ink); text-decoration: none; font-size: 0.85rem; font-weight: 500;
}
.bib-pill:hover { border-color: var(--green); background: var(--green-lt); }
.bib-pill-actif { background: var(--green); border-color: var(--green); }
.bib-count { background: var(--line); border-radius: var(--radius-pill); padding: 0 0.5rem; font-size: 0.75rem; font-weight: 600; color: var(--muted); }
.bib-pill-actif .bib-count { background: rgba(255, 255, 255, 0.55); color: var(--ink); }
.bib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 1.1rem; margin: 0.75rem 0 3rem; }
.bib-card {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-card); text-decoration: none; color: inherit;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.bib-card:hover { transform: translateY(-3px); border-color: var(--green); box-shadow: 0 10px 30px rgba(0, 0, 0, 0.10); }
.bib-card-img { position: relative; aspect-ratio: 1 / 1; background: var(--line); }
.bib-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib-noimg { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 0.85rem; }
.bib-badges { position: absolute; top: 0.6rem; right: 0.6rem; display: flex; gap: 0.3rem; }
.bib-badge {
    width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.68rem; font-weight: 700; color: #fff;
}
.bib-badge-ok { background: var(--green); }
.bib-badge-labup { background: var(--ink); }
.bib-badge-fitup { background: #EC681C; }
.bib-notice {
    position: absolute; bottom: 0.6rem; right: 0.6rem;
    background: rgba(255, 255, 255, 0.95); border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem; font-size: 0.72rem; font-weight: 600;
}
.bib-card-body { padding: 1rem 1.1rem 1.2rem; }
.bib-card-body h3 { margin: 0 0 0.3rem; font-size: 1rem; font-weight: 600; }
.bib-card-body p { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.85rem; }
.bib-card-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.bib-tag { background: var(--green-lt); color: var(--green-dark); border-radius: var(--radius-pill); padding: 0.1rem 0.55rem; font-size: 0.72rem; font-weight: 600; }
/* --- BibliUP : fiche détail --- */
.bib-retour { margin: 1.25rem 0 0.5rem; }
.bib-fiche { display: grid; grid-template-columns: 1fr 1.1fr; gap: 1.5rem; align-items: start; margin: 0.5rem 0 2rem; }
@media (max-width: 760px) { .bib-fiche { grid-template-columns: 1fr; } }
.bib-fiche-photo {
    position: relative; overflow: hidden; aspect-ratio: 1 / 1;
    border: 1px solid var(--border); border-radius: var(--radius-card);
    background: var(--line);
}
.bib-fiche-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib-licence {
    position: absolute; bottom: 0.75rem; right: 0.75rem;
    background: rgba(255, 255, 255, 0.92); border-radius: var(--radius-pill);
    padding: 0.2rem 0.7rem; font-size: 0.78rem; font-weight: 600;
}
.bib-fiche-infos h1 { margin: 0.5rem 0; font-size: 1.7rem; line-height: 1.2; }
.bib-dl { margin-top: 1.25rem; }
.bib-dl .btn { display: block; text-align: center; margin: 0.5rem 0; }
.bib-btn-gcode { background: var(--orange); }
.bib-btn-gcode:hover { background: #e69f22; }
.bib-dl-off {
    display: block; text-align: center; margin: 0.5rem 0;
    padding: 0.65rem 1.3rem; border-radius: var(--radius-pill);
    background: var(--line); color: var(--muted); font-weight: 600; font-size: 0.95rem;
}
.bib-btn-video { display: block; width: 100%; text-align: center; margin-top: 0.75rem; }
.bib-video-modal {
    border: none; border-radius: var(--radius-card); padding: 0;
    width: min(860px, 92vw); box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
.bib-video-modal::backdrop { background: rgba(0, 0, 0, 0.75); }
.bib-video-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 0.7rem 1rem; font-weight: 600; }
.bib-video-modal-head button { background: none; border: none; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted); }
.bib-video-modal-head button:hover { color: var(--ink); }
.bib-video-modal video { width: 100%; display: block; }
.bib-infos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0.75rem; margin: 0.75rem 0 1.5rem; }
.bib-info { background: var(--white); border: 1px solid var(--border); border-radius: 14px; padding: 0.8rem 1rem; }
.bib-info-label { font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); margin-bottom: 0.15rem; }
.bib-info-val { font-weight: 600; }

/* --- BibliUP : favoris --- */
.bib-card-wrap { position: relative; scroll-margin-top: 90px; }
.bib-card-wrap .bib-card { height: 100%; }
.bib-fav-form { position: absolute; top: 0.6rem; left: 0.6rem; z-index: 3; margin: 0; }
.bib-fav {
    width: 34px; height: 34px; border: none; border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    font-size: 1.05rem; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.15s;
}
.bib-fav:hover { transform: scale(1.15); }
.bib-fiche-titre { display: flex; align-items: center; gap: 0.75rem; }
.bib-fiche-titre h1 { flex: 1; }
.bib-fiche-titre .bib-fav-form { position: static; }
.bib-pill-fav.bib-pill-actif { background: #e74c3c; border-color: #e74c3c; color: #fff; }
.bib-pill-fav.bib-pill-actif .bib-count { background: rgba(255, 255, 255, 0.35); color: #fff; }

/* --- BibliUP : avis --- */
.bib-etoiles { color: #FFB330; letter-spacing: 2px; }
.bib-etoile-vide { color: #ddd; }
.bib-etoiles-sm { font-size: 0.85rem; letter-spacing: 1px; }
.bib-avis-moyenne { display: flex; align-items: center; gap: 0.5rem; margin: 0.25rem 0 1rem; font-size: 1.05rem; }
.bib-avis-form { display: grid; gap: 0.6rem; margin: 0 0 1rem; }
.bib-avis-form textarea {
    padding: 0.6rem 0.9rem; border: 1px solid var(--border);
    border-radius: 14px; font: inherit; resize: vertical; background: var(--white);
}
.bib-avis-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(0, 206, 117, 0.15); }
.bib-avis-form .btn { justify-self: start; }
.bib-note-choix { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.bib-note-choix input { display: none; }
.bib-note-choix label { font-size: 1.7rem; line-height: 1; color: #ddd; cursor: pointer; transition: color 0.1s; }
.bib-note-choix input:checked ~ label,
.bib-note-choix label:hover,
.bib-note-choix label:hover ~ label { color: #FFB330; }
.bib-avis-item { border-top: 1px solid var(--line); padding-top: 0.75rem; margin-top: 0.75rem; }
.bib-avis-tete { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; font-size: 0.9rem; }
.bib-avis-item p { margin: 0.35rem 0 0; color: var(--muted); font-size: 0.9rem; }

/* --- BibliUP : carrousel + encart Merci --- */
.bib-caroumerci { display: flex; gap: 1rem; align-items: stretch; margin: 0 0 1.5rem; }
.bib-carrousel { flex: 1; min-width: 0; }
.bib-carrousel-titre { font-size: 1.05rem; margin: 0 0 0.6rem; }
.bib-carrousel-items { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.bib-carrousel-item {
    display: block; background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-card); overflow: hidden; text-decoration: none;
    color: inherit; box-shadow: var(--shadow-card);
    transition: transform 0.15s, border-color 0.15s;
}
.bib-carrousel-item:hover { transform: translateY(-3px); border-color: var(--green); }
.bib-carrousel-item img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; background: var(--line); }
.bib-carrousel-nom { padding: 0.5rem 0.6rem 0.15rem; font-size: 0.8rem; font-weight: 600; }
.bib-carrousel-tag { padding: 0 0.6rem 0.5rem; font-size: 0.72rem; color: var(--muted); }
.bib-merci {
    flex: 0 0 190px; border-radius: var(--radius-card);
    background: linear-gradient(135deg, #a575ff 0%, #7c4dff 100%);
    color: #fff; display: flex; flex-direction: column; align-items: center;
    justify-content: center; text-align: center; padding: 1.1rem;
}
.bib-merci img {
    width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.5); margin-bottom: 0.6rem;
}
.bib-merci-txt { margin: 0; font-weight: 700; }
.bib-merci-obj { margin: 0.3rem 0 0; font-size: 0.8rem; opacity: 0.9; }
@media (max-width: 760px) {
    .bib-caroumerci { flex-direction: column; }
    .bib-carrousel-items { grid-template-columns: repeat(2, 1fr); }
    .bib-merci { flex-basis: auto; }
}

/* --- BibliUP : bouton fitUP --- */
.bib-btn-fitup {
    display: flex; align-items: center; justify-content: center; gap: 0.5rem;
    background: #EC681C; margin-top: 0.75rem; width: 100%;
}
.bib-btn-fitup:hover { background: #EC681C; filter: brightness(0.92); }
.bib-btn-fitup img { width: 22px; height: 22px; }
.bib-pill-ico { width: 16px; height: 16px; }
.bib-edit { font-size: 1.1rem; text-decoration: none; margin-left: 0.25rem; }

/* --- BibliUP : formulaire de contribution --- */
.bib-form { max-width: 760px; margin: 0 0 3rem; }
.bib-form .panel { margin-bottom: 1.25rem; }
.bib-champ { margin: 0 0 0.9rem; display: flex; flex-direction: column; gap: 0.3rem; }
.bib-champ label { font-weight: 600; font-size: 0.9rem; }
.bib-champ label small { font-weight: 400; color: var(--muted); }
.bib-champ input[type="text"], .bib-champ input[type="number"],
.bib-champ textarea, .bib-champ select {
    padding: 0.6rem 0.9rem; border: 1px solid var(--border); border-radius: 14px;
    font: inherit; background: var(--white); width: 100%;
}
.bib-champ input:focus, .bib-champ textarea:focus, .bib-champ select:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 206, 117, 0.15);
}
.bib-champ input[type="file"] { font-size: 0.9rem; }
.bib-champ .errorlist { color: #c0392b; margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }
.bib-form-erreurs {
    background: #fdecea; border: 1px solid #f5c6c2; border-radius: 14px;
    padding: 0.75rem 1rem; margin-bottom: 1rem; color: #c0392b;
}
.bib-duree { display: flex; gap: 0.75rem; }
.bib-duree .bib-champ { flex: 1; }
.bib-check { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; margin: 0 0 0.5rem; cursor: pointer; }
.bib-check input { width: 18px; height: 18px; accent-color: var(--green); }
.bib-form-tags label { font-weight: 400; font-size: 0.9rem; display: flex; align-items: center; gap: 0.45rem; }
.bib-form-tags > label { font-weight: 600; }
.bib-form-tags div, .bib-form-tags ul {
    list-style: none; margin: 0; padding: 0;
    display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.25rem;
}
.bib-form-tags input { accent-color: var(--green); }

/* --- BibliUP : boîte à idées --- */
.bib-btn-idees { margin-left: auto; }
.bib-btn-ajout { margin-left: 0; }
.bib-idees { max-width: 760px; margin: 0 0 3rem; display: grid; gap: 1rem; }
.bib-idee {
    background: var(--white); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 1.1rem 1.25rem;
    box-shadow: var(--shadow-card); scroll-margin-top: 90px;
}
.bib-idee-top { border-left: 4px solid #f1c40f; }
.bib-idee-tete { display: flex; align-items: center; gap: 0.6rem; }
.bib-idee-tete h3 { margin: 0; font-size: 1.05rem; flex: 1; }
.bib-idee-badge {
    background: #f1c40f; color: #fff; border-radius: var(--radius-pill);
    padding: 0.15rem 0.6rem; font-size: 0.72rem; font-weight: 700; white-space: nowrap;
}
.bib-idee-photo { width: 100%; max-height: 180px; object-fit: cover; border-radius: 12px; margin-bottom: 0.6rem; }
.bib-idee-desc { color: var(--muted); font-size: 0.92rem; margin: 0.5rem 0; }
.bib-idee-meta { display: flex; align-items: center; gap: 0.6rem; margin: 0.5rem 0 0.75rem; font-size: 0.85rem; }
.bib-idee-actions { display: flex; align-items: center; gap: 0.5rem; }
.bib-vote {
    border: 1.5px solid var(--border); background: var(--white);
    border-radius: var(--radius-pill); padding: 0.35rem 0.9rem;
    font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
}
.bib-vote:hover { border-color: var(--green); background: var(--green-lt); }
.bib-vote-actif { background: var(--green); border-color: var(--green); }
.bib-idee-suppr { border: none; background: none; font-size: 1.05rem; cursor: pointer; opacity: 0.6; }
.bib-idee-suppr:hover { opacity: 1; }
.bib-idee-form { max-width: 760px; margin: 0 0 1.25rem; }
.bib-idee-form summary { display: inline-flex; cursor: pointer; list-style: none; }
.bib-idee-form summary::-webkit-details-marker { display: none; }
.bib-idee-form[open] summary { margin-bottom: 0.75rem; }
.bib-idee-form .panel { margin: 0; }

/* ===== Module tutoriels (phase 9) ===== */
.tuto-anchor { position: absolute; top: 0; visibility: hidden; }
.tuto-filtres { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0; }
.tuto-pill { display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: 25px; border: 2px solid #e0e0e0;
  background: #fff; font-size: 13px; font-weight: 500; color: #636e72;
  text-decoration: none; transition: all .2s; }
.tuto-pill:hover { border-color: #00CE75; background: #f0fff8; }
.tuto-pill.active { background: linear-gradient(135deg, #00CE75, #00B894);
  border-color: #00CE75; color: #fff; }
.tuto-count { background: #e9ecef; color: #636e72; padding: 1px 8px;
  border-radius: 12px; font-size: 11px; font-weight: 600; }
.tuto-pill.active .tuto-count { background: rgba(255,255,255,.3); color: #fff; }
.tuto-grille { display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px; align-items: start; margin-top: 10px; }
.tuto-carte { background: #fff; border-radius: 16px; overflow: hidden;
  box-shadow: 0 6px 24px rgba(0,0,0,.08); text-decoration: none;
  color: inherit; display: flex; flex-direction: column;
  transition: transform .25s, box-shadow .25s; }
.tuto-carte:hover { transform: translateY(-5px);
  box-shadow: 0 14px 40px rgba(0,0,0,.14); }
.tuto-vignette { position: relative; aspect-ratio: 16/9; background: #000;
  overflow: hidden; }
.tuto-vignette img { width: 100%; height: 100%; object-fit: cover;
  transition: transform .35s; }
.tuto-carte:hover .tuto-vignette img { transform: scale(1.05); }
/* La couleur du badge vient de Tag.couleur, posee en style inline par le
   gabarit. Le gris ci-dessous n'est qu'un repli pour un tag sans couleur.
   Les quatre variantes .tuto-badge-<tag> qui figuraient ici etaient sans
   effet : cette regle, de meme specificite, passait apres elles. */
.tuto-badge { position: absolute; top: 10px; left: 10px; padding: 4px 10px;
  border-radius: 14px; font-size: 11px; font-weight: 600; color: #fff;
  background: rgba(99,110,114,.92); }
.tuto-badge-short { position: absolute; top: 10px; right: 10px;
  background: rgba(255,107,107,.95); padding: 4px 10px; border-radius: 14px;
  font-size: 11px; font-weight: 700; color: #fff; }
.tuto-play { position: absolute; inset: 0; display: flex;
  align-items: center; justify-content: center; font-size: 26px;
  color: #00CE75; }
.tuto-play::before { content: ""; position: absolute; width: 54px;
  height: 54px; border-radius: 50%; background: rgba(255,255,255,.95);
  box-shadow: 0 4px 18px rgba(0,0,0,.3); z-index: -1;
  transition: transform .25s; }
.tuto-carte:hover .tuto-play::before { transform: scale(1.12); }
.tuto-corps { padding: 14px 16px; }
.tuto-corps h3 { margin: 0; font-size: 15px; line-height: 1.4; }
.tuto-corps p { margin: 6px 0 0; font-size: 13px; color: #636e72; }
.tuto-modale { display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.92); z-index: 10001; align-items: center;
  justify-content: center; padding: 20px; }
.tuto-modale:target { display: flex; }
.tuto-modale-fond { position: absolute; inset: 0; }
.tuto-modale-contenu { position: relative; background: #000;
  border-radius: 14px; overflow: hidden; width: 100%; }
.tuto-modale-contenu.horizontal { max-width: 900px; aspect-ratio: 16/9; }
.tuto-modale-contenu.vertical { max-width: 380px; aspect-ratio: 9/16;
  max-height: 85vh; }
.tuto-modale-contenu iframe, .tuto-modale-contenu video { width: 100%;
  height: 100%; border: none; display: block; }
.tuto-modale-fermer { position: absolute; top: 6px; right: 12px;
  color: #fff; font-size: 34px; text-decoration: none; z-index: 2;
  text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.tuto-tag-point { display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; }
/* Astuces du bandeau d'accueil, listees ici en permanence (lot C).
   Aucun JavaScript : la modale reutilise le :target des videos. */
.tuto-vignette.astuce { background: linear-gradient(135deg, #a575ff, #7d4ce0); }
.tuto-vignette.astuce.vide::after { content: "💡"; position: absolute;
  inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 44px; }
.tuto-modale-contenu.texte { background: #fff; color: #2d3436;
  max-width: 680px; max-height: 85vh; overflow-y: auto; padding: 26px 30px; }
.tuto-modale-contenu.texte h2 { margin: 0; font-size: 20px;
  padding-right: 34px; }
.tuto-modale-contenu.texte .astuce-precision { margin: 4px 0 14px;
  font-size: 13px; color: #636e72; }
.tuto-modale-contenu.texte p { font-size: 15px; line-height: 1.6; }
.tuto-modale-contenu.texte img { display: block; width: 100%;
  border-radius: 10px; margin: 0 0 14px; }
.tuto-modale-contenu.texte .tuto-modale-fermer { color: #636e72;
  text-shadow: none; }

/* --- Module matériaux (phase 10, session 5) ------------------------------ */
.mat-qte { width: 5.5rem; }
.mat-form .btn { margin-right: 0.75rem; }

/* --- Qualification réglementaire (phase 11, session 11.2) --- */
.bib-badge-dm { background: #1668a7; }
.bib-notice-dm {
    border-left: 4px solid #1668a7;
    background: #eef5fb;
    padding: 10px 14px;
    border-radius: 6px;
    margin: 12px 0;
}
.bib-dl-avertissement {
    font-size: 0.85em;
    color: #555;
    margin: 4px 0 10px;
}


/* --- PildiUP : vues métier (liste et fiche dossier) --- */
.pil-pill { display: inline-block; padding: 0.12rem 0.65rem; border-radius: var(--radius-pill); font-size: 0.76rem; font-weight: 600; white-space: nowrap; }
.pil-regime-DMSM { background: var(--green-lt); color: var(--green-dark); }
.pil-regime-DMIH { background: #eef5fb; color: #1668a7; }
.pil-regime-HORS_DM { background: var(--line); color: var(--muted); }
.pil-regime-CE_REQUIS { background: var(--red-lt); color: var(--red); }
.pil-regime-NA { background: var(--orange-lt); color: #8a5b00; }
.pil-etat { background: var(--line); color: var(--muted); }
.pil-etat-NOUVEAU { background: var(--orange-lt); color: #8a5b00; }
.pil-etat-REMISE, .pil-etat-EN_SERVICE { background: var(--green-lt); color: var(--green-dark); }
.pil-etat-BLOQUE, .pil-etat-RETIRE, .pil-etat-RAPPELE { background: var(--red-lt); color: var(--red); }
.pil-lien a { color: var(--ink); font-weight: 600; text-decoration: none; }
.pil-lien a:hover { color: var(--green-dark); text-decoration: underline; }
.pil-meta { color: var(--muted); font-size: 0.82rem; margin-bottom: 0; }
.pil-pagination { display: flex; gap: 1rem; align-items: center; margin: 1.2rem 0; }
.pil-pagination a { color: var(--green-dark); text-decoration: none; }
.pil-pagination a:hover { text-decoration: underline; }
.pil-reponses summary { cursor: pointer; color: var(--green-dark); font-size: 0.9rem; }
.pil-reponses ul { margin: 0.5rem 0 0; padding-left: 1.2rem; font-size: 0.9rem; }
.pil-pills-titre { display: flex; gap: 0.4rem; flex-wrap: wrap; margin: 0.4rem 0 1rem; }
.bib-infos-grid .bib-info-val { overflow-wrap: anywhere; }

/* --- PildiUP S6 : barre de navigation du module --- */
.pil-nav { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; margin: 1.25rem 0 0.75rem; }
.pil-nav a.nav-link-back {
    display: inline-flex; align-items: center;
    padding: 0.4rem 0.95rem; border-radius: var(--radius-pill);
    border: 1.5px solid var(--border); background: var(--white);
    color: var(--ink); font-size: 0.9rem; font-weight: 600;
    text-decoration: none;
}
.pil-nav a.nav-link-back:hover {
    border-color: var(--green); background: var(--green-lt);
    text-decoration: none;
}

/* --- PildiUP S6 : lexique --- */
.pil-lexique { margin: 0; }
.pil-lexique dt { font-weight: 600; margin-top: 0.9rem; }
.pil-lexique dt:first-child { margin-top: 0; }
.pil-lexique dd { margin: 0.15rem 0 0; color: var(--muted); font-size: 0.95rem; }

/* --- PildiUP S6 : formulaires (rythme vertical, champs) --- */
.form-row { margin: 0 0 1rem; display: flex; flex-direction: column; gap: 0.3rem; max-width: 560px; }
.form-row label { font-weight: 600; font-size: 0.9rem; }
.form-row input[type="text"], .form-row input[type="number"],
.form-row input[type="email"], .form-row input[type="url"],
.form-row input[type="date"], .form-row textarea, .form-row select {
    padding: 0.6rem 0.9rem; border: 1px solid var(--border);
    border-radius: var(--radius-input); font: inherit;
    background: var(--white); width: 100%;
}
.form-row input:focus, .form-row textarea:focus, .form-row select:focus {
    outline: none; border-color: var(--green);
    box-shadow: 0 0 0 3px rgba(0, 206, 117, 0.15);
}
.form-row input[type="file"] { font-size: 0.9rem; }
.form-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--green); }
.form-row:has(input[type="checkbox"]) { flex-direction: row; align-items: center; gap: 0.5rem; }
.form-row .muted { font-size: 0.85rem; margin: 0; }
.form-row .errorlist { color: var(--red); margin: 0; padding-left: 1.1rem; font-size: 0.85rem; }

/* --- PildiUP S6 : guide utilisateur --- */
.pg-hero { background: var(--green-lt); border: 1.5px solid var(--green-soft); border-radius: var(--radius-card); padding: 1.5rem 1.75rem; font-size: 1.15rem; font-weight: 600; margin: 1rem 0 2rem; }
.pg-flow { display: flex; flex-direction: column; gap: 0; max-width: 560px; margin: 1rem 0 1rem; }
.pg-step { background: var(--white); border: 1.5px solid var(--border); border-radius: 14px; padding: 0.85rem 1.1rem; box-shadow: var(--shadow-card); }
.pg-step strong { display: block; margin-bottom: 0.15rem; }
.pg-step .muted { font-size: 0.9rem; }
.pg-arrow { text-align: center; color: var(--green-dark); font-size: 1.4rem; line-height: 1; padding: 0.3rem 0; max-width: 560px; }
.pg-issues { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0.75rem; margin: 0.5rem 0 1.5rem; }
.pg-issue { border-radius: 14px; padding: 0.9rem 1rem; border: 1.5px solid var(--border); background: var(--white); }
.pg-issue h4 { margin: 0 0 0.3rem; font-size: 0.95rem; }
.pg-issue p { margin: 0; font-size: 0.85rem; color: var(--muted); }
.pg-issue-vert { border-color: var(--green-soft); background: var(--green-lt); }
.pg-issue-bleu { border-color: #bcd7ec; background: #eef5fb; }
.pg-issue-gris { background: var(--line); }
.pg-issue-rouge { border-color: #ffc4c2; background: var(--red-lt); }
.pg-frise { display: flex; flex-wrap: wrap; align-items: stretch; gap: 0.5rem; margin: 1rem 0; }
.pg-frise .pg-step { flex: 1; min-width: 160px; }
.pg-frise-arrow { color: var(--green-dark); font-size: 1.4rem; align-self: center; }
.pg-bulle { position: relative; background: var(--white); border: 1.5px solid var(--green); border-radius: 18px; padding: 0.9rem 1.2rem; margin: 1.25rem 0 1.25rem 1.25rem; max-width: 620px; }
.pg-bulle::before { content: ""; position: absolute; left: -16px; top: 16px; border: 8px solid transparent; border-right-color: var(--green); }
.pg-bulle strong { color: var(--green-dark); }
.pg-danger { border-color: var(--red); }
.pg-danger::before { border-right-color: var(--red); }
.pg-danger strong { color: var(--red); }


/* Lot 0 (18/07/2026) : l'état des documents sur la fiche dossier */
.pil-doc-etat { display: inline-block; padding: .15rem .55rem;
  border-radius: 999px; font-size: .85em; white-space: nowrap; }
.pil-doc-BROUILLON, .pil-doc-VALIDE { background: #fff3e0; color: #9a5b00;
  border: 1px solid #f0c27a; }
.pil-doc-VERROUILLE { background: #e6f4ea; color: #1e7b34;
  border: 1px solid #9fd3ac; }
.pil-doc-SUPERSEDE { background: #eeeeee; color: #666666;
  border: 1px solid #cccccc; }


/* Lot 2 (2.7) : l'ecran de qualification, titres et sous-titres. */
.pil-question { margin-bottom: 1.1rem; }
.pil-question-titre { display: block; font-size: 1.05rem; font-weight: 600; margin-bottom: .15rem; }
.pil-question-aide { margin: 0 0 .5rem; font-size: .9rem; }
.pil-question-rare { margin: .8rem 0 1rem; }
.pil-question-rare summary { cursor: pointer; color: #667; font-size: .95rem; }

/* Lot 6.3 : le menu du module PildiUP, en onglets */
.pil-menu { display: flex; flex-wrap: wrap; align-items: flex-end;
  margin: 0 0 1.6rem; border-bottom: 2px solid var(--green-dark); }
.pil-menu a { color: var(--ink); text-decoration: none;
  padding: 0.45rem 0.85rem; font-size: 0.95rem;
  border-radius: 8px 8px 0 0; }
.pil-menu a:hover { background: rgba(0, 0, 0, 0.06); }
.pil-menu a.actif { background: var(--green-dark); color: #fff;
  font-weight: 600; }
.pil-menu .pil-menu-aide { margin-left: auto; }
.pil-menu .pil-menu-aide a { color: #667; font-size: 0.9rem; }

/* 7.3 : la pastille d'aide contextuelle vers le guide */
.pil-aide { display: inline-flex; align-items: center; justify-content: center;
  width: 1.35rem; height: 1.35rem; margin-left: 0.45rem; border-radius: 50%;
  background: var(--green-lt); color: var(--green-dark);
  border: 1.5px solid var(--green-soft); font-size: 0.85rem; font-weight: 700;
  text-decoration: none; vertical-align: middle; }
.pil-aide:hover { background: var(--green-dark); color: var(--white); border-color: var(--green-dark); }
#parcours, #documents, #vie-en-service, #roles, #reflexes,
#machines, #reclamations, #revues, #declarations { scroll-margin-top: 90px; }

/* 7.3b : le bloc d'aide propre a la page, deplie par la pastille */
.pil-aide-bloc { margin: 0.25rem 0 1rem; }
.pil-aide-bloc summary { cursor: pointer; list-style: none; color: var(--green-dark);
  font-size: 0.9rem; font-weight: 600; display: inline-flex; align-items: center; gap: 0.4rem; }
.pil-aide-bloc summary::-webkit-details-marker { display: none; }
.pil-aide-bloc summary:hover { text-decoration: underline; }
.pil-aide-bloc .pil-aide { margin-left: 0; }
.pil-aide-texte { background: var(--white); border: 1.5px solid var(--green-soft);
  border-radius: var(--radius-card); padding: 0.9rem 1.1rem; margin-top: 0.5rem;
  max-width: 760px; font-size: 0.95rem; }
.pil-aide-texte p { margin: 0 0 0.6rem; }
.pil-aide-texte p:last-child { margin-bottom: 0; }

/* 7.4 : formulaires, blocs moins massifs, titres remontes, selects alignes */
form .panel { padding: 1.1rem 1.35rem; }
form .panel h2 { margin: 0 0 0.9rem; font-size: 1.25rem; }
.form-row select, .bib-champ select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23556b62' stroke-width='2'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

/* 7.5 : l'ecran reglementaire, titres nets, articles en repli */
.panel h2 { margin: 0 0 0.6rem; font-size: 1.3rem; }
.reg-pourquoi { margin: 0.3rem 0 0; }
.reg-pourquoi summary { cursor: pointer; list-style: none; color: var(--green-dark);
  font-weight: 600; font-size: 0.85rem; }
.reg-pourquoi summary::-webkit-details-marker { display: none; }
.reg-pourquoi summary:hover { text-decoration: underline; }
.reg-pourquoi p { margin: 0.35rem 0 0; font-size: 0.85rem; }

/* 7.8b : de l'air entre les boutons d'action des tableaux */
.table td .btn { margin: 0.15rem 0.35rem 0.15rem 0; }

/* Entete : hauteur unique sur tout le site, et logo en image au lieu du
   texte Lab + UP. La barre mesure 64px : le remplissage vertical de
   .site-header est a zero, seule cette hauteur minimale compte.
   Le logo de 32px garde donc 16px d'air en haut et en bas.
   Ces deux regles venaient de entete.css, que base.html ne charge plus ;
   entete.css sert desormais aux seules pages autonomes, et porte les
   MEMES valeurs : toute modification ici est a reporter la-bas, jusqu'au
   socle commun du lot A. */
.site-header .header-inner { min-height: 64px; }
.site-header .brand img { height: 32px; width: auto; display: block; flex: 0 0 auto; }

/* Reserve toujours la place de la barre de defilement, sinon le logo
   et le contenu se decalent de quelques pixels entre une page longue
   et une page courte. */
html { scrollbar-gutter: stable; }
