/* ============================================================
   SUIVI DE COURS - Style (tablette + mobile + PC)
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: "Segoe UI", Calibri, Arial, sans-serif;
    background: #F4F6F9;
    color: #333;
}

/* ---------- Page de connexion ---------- */
.page-login {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #2C3E63, #4A6FD9);
}
.carte-login {
    background: white;
    padding: 40px 36px;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.25);
    text-align: center;
    width: 90%;
    max-width: 340px;
}
.carte-login h1 { color: #2C3E63; margin: 0 0 4px; font-size: 26px; }
.carte-login .sous-titre { color: #888; margin: 0 0 20px; font-style: italic; }
.carte-login input[type="password"], .carte-login input[type="text"], .carte-login input[type="email"] {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    border: 2px solid #D7DEE8;
    border-radius: 10px;
    margin-bottom: 14px;
    text-align: center;
}
.carte-login button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background: #4A6FD9;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.carte-login button:active { background: #3A5BC0; }
.erreur { color: #E4572E; font-weight: bold; }

/* ---------- Bandeau ---------- */
.bandeau {
    background: #2C3E63;
    color: white;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}
.bandeau h1 { font-size: 20px; margin: 0; display: inline; }
.bandeau .sous { color: #AEB9D6; font-style: italic; margin-left: 8px; font-size: 13px; }
.bandeau-boutons a, .bandeau-boutons button {
    background: #9B59B6;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    font-size: 14px;
    margin-left: 8px;
    display: inline-block;
}
.bandeau-boutons .btn-deconnexion { background: #8A93A3; }

/* ---------- Barre de recherche ---------- */
.barre-recherche {
    display: flex;
    gap: 8px;
    padding: 14px 20px 0;
    flex-wrap: wrap;
}
.barre-recherche input[type="text"] {
    flex: 1;
    min-width: 180px;
    padding: 10px 12px;
    border: 2px solid #D7DEE8;
    border-radius: 8px;
    font-size: 15px;
}
.barre-recherche button {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    background: #4A6FD9;
    cursor: pointer;
}
.barre-recherche .btn-effacer { background: #8A93A3; }

/* ---------- Corps : colonnes ---------- */
.corps {
    display: flex;
    gap: 16px;
    padding: 16px 20px 40px;
    align-items: flex-start;
}
@media (max-width: 930px) {
    .corps { flex-direction: column; }
    .colonne-gauche { width: 100% !important; }
}

.colonne-gauche {
    background: white;
    border: 1px solid #D7DEE8;
    border-radius: 12px;
    width: 300px;
    flex-shrink: 0;
    padding: 12px;
}
.boutons-matiere-cours {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}
.boutons-matiere-cours button {
    flex: 1;
    padding: 10px;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    font-size: 13px;
}
.btn-matiere { background: #4A6FD9; }
.btn-cours { background: #00B8A9; }

.arbre { list-style: none; margin: 0; padding: 0; }
.arbre .matiere { margin-bottom: 4px; }
.arbre .nom-matiere {
    font-weight: bold;
    padding: 10px 8px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.arbre .nom-matiere > span:first-child {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.arbre .liste-cours { list-style: none; margin: 2px 0 6px 14px; padding: 0; }
.arbre .nom-cours {
    padding: 9px 10px;
    border-radius: 8px;
    cursor: pointer;
    margin-bottom: 3px;
    background: #F4F6F9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 6px;
}
.arbre .nom-cours > span:first-child {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.arbre .nom-cours.actif { color: white; font-weight: bold; }
.arbre .nom-cours .icone-menu, .arbre .nom-matiere .icone-menu {
    opacity: 0.6;
    padding: 2px 8px;
    flex-shrink: 0;
}

/* ---------- Colonne droite ---------- */
.colonne-droite { flex: 1; min-width: 0; }
.entete-droite {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}
.fil-ariane { font-size: 18px; font-weight: bold; min-width: 0; overflow-wrap: break-word; word-break: break-word; }
.btn-nouveau-chapitre {
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    background: #8A93A3;
    font-size: 14px;
}
.message-vide {
    color: #999;
    font-style: italic;
    padding: 30px 0;
}

/* ---------- Carte chapitre ---------- */
.carte-chapitre {
    border-radius: 12px;
    margin-bottom: 14px;
    overflow: hidden;
    border: 2px solid;
}
.carte-entete {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    color: white;
    cursor: pointer;
}
.carte-titre {
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}
.carte-boutons { display: flex; gap: 6px; flex-wrap: wrap; flex-shrink: 0; }
.carte-boutons button, .badge-revise {
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}
.badge-revise.oui { background: #2ECC71; color: white; }
.badge-revise.non { background: #F4B400; color: white; }
.btn-blanc { background: white; }

.carte-corps { display: none; padding: 14px; }
.carte-corps.ouvert { display: block; }

.onglets { display: flex; gap: 4px; margin-bottom: 10px; flex-wrap: wrap; }
.onglets button {
    padding: 9px 14px;
    border: none;
    border-radius: 8px 8px 0 0;
    font-weight: bold;
    cursor: pointer;
    background: white;
    font-size: 13px;
}
.onglets button.actif { color: white; }

.zone-onglet { display: none; }
.zone-onglet.actif { display: block; }
.zone-onglet textarea {
    width: 100%;
    min-height: calc(100vh - 330px);
    padding: 10px;
    border: 1px solid #D7DEE8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    background: white;
}
@media (max-width: 930px) {
    .zone-onglet textarea { min-height: calc(100vh - 420px); }
}
.statut-sauvegarde { font-size: 12px; font-style: italic; text-align: right; margin-top: 4px; min-height: 16px; }

/* ---------- Documents joints ---------- */
.zone-documents { margin-bottom: 10px; background: white; border-radius: 8px; padding: 10px; }
.zone-documents h4 { margin: 0 0 8px; font-size: 13px; }
.liste-documents { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.doc-vignette {
    width: 90px;
    text-align: center;
    font-size: 11px;
}
.doc-vignette img { width: 90px; height: 70px; object-fit: cover; border-radius: 6px; border: 1px solid #D7DEE8; }
.doc-vignette .doc-icone {
    width: 90px; height: 70px; background: #F4F6F9; border-radius: 6px;
    display: flex; align-items: center; justify-content: center; font-size: 24px;
    border: 1px solid #D7DEE8;
}
.doc-vignette .btn-suppr-doc { color: #E4572E; cursor: pointer; font-size: 11px; }
.btn-ajouter-doc {
    display: inline-block;
    padding: 8px 12px;
    background: #4A6FD9;
    color: white;
    border-radius: 8px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
}
.btn-ajouter-doc input { display: none; }

/* ---------- Resultats de recherche ---------- */
.resultat-recherche {
    padding: 12px;
    border-radius: 8px;
    border: 1px solid;
    margin-bottom: 8px;
    cursor: pointer;
    font-weight: bold;
}

/* ---------- Note generale (fenetre modale) ---------- */
.fond-modal {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 100;
    align-items: center;
    justify-content: center;
}
.fond-modal.ouvert { display: flex; }
.modal-note {
    background: white;
    border-radius: 14px;
    width: 90%;
    max-width: 640px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    padding: 20px;
}
.modal-note h2 { color: #9B59B6; margin: 0 0 4px; }
.modal-note textarea {
    flex: 1;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #D7DEE8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    margin: 10px 0;
    resize: vertical;
}
.modal-note .boutons { display: flex; gap: 10px; justify-content: flex-end; }
.modal-note button {
    padding: 10px 18px;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    color: white;
    cursor: pointer;
}
.btn-violet { background: #9B59B6; }
.btn-gris { background: #8A93A3; }

/* ---------- Petite modale de saisie texte ---------- */
.modal-saisie .modal-note { max-width: 420px; }
.modal-saisie input[type="text"], .modal-saisie input[type="date"] {
    width: 100%;
    padding: 12px;
    border: 2px solid #D7DEE8;
    border-radius: 8px;
    font-size: 15px;
    margin: 6px 0 12px;
}

/* ---------- Ajustements telephone (petit ecran) ---------- */
@media (max-width: 480px) {
    .bandeau { padding: 10px 12px; }
    .bandeau h1 { font-size: 17px; }
    .bandeau .sous { display: block; margin-left: 0; font-size: 11px; }
    .bandeau-boutons a, .bandeau-boutons button {
        padding: 8px 10px; font-size: 12px; margin-left: 4px;
    }
    .barre-recherche { padding: 10px 12px 0; }
    .corps { padding: 10px 12px 30px; gap: 10px; }
    .colonne-gauche { padding: 8px; }
    .boutons-matiere-cours button { padding: 8px; font-size: 12px; }
    .fil-ariane { font-size: 15px; }
    .btn-nouveau-chapitre { padding: 9px 12px; font-size: 12px; }
    .carte-entete { padding: 9px 10px; font-size: 13px; }
    .onglets button { padding: 7px 9px; font-size: 11px; }
    .modal-note { padding: 14px; width: 94%; }
    .modal-note h2 { font-size: 17px; }
}

.carte-corps hr { border: none; border-top: 1px solid rgba(0,0,0,0.1); margin: 12px 0; }

/* ---------- Connexion : onglets Eleve / Administrateur ---------- */
.onglets-login {
    display: flex;
    margin-bottom: 18px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid #D7DEE8;
}
.onglet-login {
    flex: 1;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    border: none;
    background: white;
    color: #888;
    cursor: pointer;
}
.onglet-login.actif { background: #4A6FD9; color: white; }
.carte-login input[type="text"] {
    width: 100%;
    padding: 14px;
    font-size: 18px;
    border: 2px solid #D7DEE8;
    border-radius: 10px;
    margin-bottom: 14px;
    text-align: center;
}
.carte-login label {
    display: block;
    text-align: left;
    font-size: 13px;
    color: #666;
    margin: 10px 0 4px;
}

/* ---------- Bandeau d'usurpation admin ---------- */
.bandeau-impersonation {
    background: #F5A623;
    color: #3A2A00;
    text-align: center;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: bold;
}
.bandeau-impersonation a { color: #3A2A00; text-decoration: underline; }

/* ---------- Espace administrateur ---------- */
.corps-admin { max-width: 800px; margin: 20px auto; padding: 0 16px; }
.message-ok { color: #1E824C; font-weight: bold; }
.carte-admin {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.carte-admin h2 { margin-top: 0; font-size: 18px; color: #2C3E63; }
.carte-admin label { display: block; font-size: 13px; color: #666; margin: 10px 0 4px; }
.carte-admin input[type="text"], .carte-admin input[type="email"], .carte-admin textarea {
    width: 100%;
    padding: 10px;
    font-size: 15px;
    border: 2px solid #D7DEE8;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
}
.ligne-compte {
    border-top: 1px solid #EEE;
    padding: 12px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.ligne-compte-info { display: flex; flex-direction: column; gap: 4px; }
.detail-compte { color: #888; font-size: 13px; }
.badge-statut { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 10px; width: fit-content; }
.badge-actif { background: #DFF5E5; color: #1E824C; }
.badge-bloque { background: #FBE0DD; color: #C0392B; }
.ligne-compte-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.btn-petit {
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}
.btn-danger { background: #E4572E; color: white; }
.form-reinit {
    width: 100%;
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.form-reinit input {
    flex: 1;
    padding: 8px;
    border: 2px solid #D7DEE8;
    border-radius: 6px;
}

/* Barre de force du mot de passe */
.barre-force-conteneur {
    width: 100%;
    height: 8px;
    background: #E3E8EF;
    border-radius: 4px;
    margin: 6px 0 4px;
    overflow: hidden;
}
.barre-force {
    height: 100%;
    width: 0%;
    background: #E74C3C;
    border-radius: 4px;
    transition: width 0.2s, background 0.2s;
}
.texte-force {
    font-size: 13px;
    color: #888;
    margin: 0 0 12px;
    text-align: left;
}

/* ============================================================
   Page de connexion - nouvelle presentation (ecran d'accueil)
   ============================================================ */
.page-login-hero {
    min-height: 100vh;
    display: flex;
    background: #F7F2E9;
    font-family: "Segoe UI", Calibri, Arial, sans-serif;
}
.panel-illustration {
    flex: 1.1;
    background: #FBF7EF;
    background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,0.9), transparent 55%),
                       radial-gradient(circle at 90% 85%, rgba(227,162,60,0.14), transparent 50%);
    color: #3A3226;
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-right: 1px solid #ECE4D4;
}
.panel-illustration .marque {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 30px;
    font-weight: 600;
    margin: 0 0 6px;
    color: #2C3E63;
}
.panel-illustration .accroche {
    font-size: 17px;
    color: #7A7261;
    max-width: 360px;
    line-height: 1.5;
    margin: 0 0 44px;
}
.pile-livres {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 230px;
}
.livre {
    padding: 14px 18px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 14px rgba(58,50,38,0.1);
}
.livre-1 { background: #4A6FD9; color: white; }
.livre-2 { background: #7FA88F; color: white; margin-left: 18px; }
.livre-3 { background: #E3A23C; color: #3A3226; margin-left: 8px; }
.livre-4 { background: white; color: #2C3E63; border: 1px solid #ECE4D4; margin-left: 26px; }
.note-collante {
    position: absolute;
    right: 60px;
    top: 70px;
    background: #FFF4D9;
    color: #6B5A2E;
    padding: 16px 20px;
    width: 190px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    transform: rotate(4deg);
    border-radius: 4px;
    box-shadow: 0 8px 18px rgba(58,50,38,0.12);
}
.panel-formulaire {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.carte-login-hero {
    background: white;
    padding: 44px 40px;
    border-radius: 18px;
    box-shadow: 0 16px 40px rgba(31,43,77,0.12);
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.carte-login-hero h1 {
    font-family: Georgia, 'Times New Roman', serif;
    color: #1F2B4D;
    margin: 0 0 4px;
    font-size: 26px;
}
.carte-login-hero .sous-titre-hero {
    color: #8A93A6;
    margin: 0 0 26px;
    font-size: 14px;
}
.carte-login-hero input[type="password"], .carte-login-hero input[type="text"], .carte-login-hero input[type="email"] {
    width: 100%;
    padding: 13px 14px;
    font-size: 16px;
    border: 2px solid #E7E2D6;
    border-radius: 10px;
    margin-bottom: 14px;
    background: #FCFAF5;
}
.carte-login-hero button {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    color: #1F2B4D;
    background: #E3A23C;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background 0.15s;
}
.carte-login-hero button:hover { background: #D8922B; }
.carte-login-hero .liens-bas { margin-top: 22px; font-size: 14px; }
.carte-login-hero .liens-bas a {
    color: #1F2B4D;
    text-decoration: none;
    font-weight: 600;
}
.carte-login-hero .liens-bas a:hover { text-decoration: underline; }
.carte-login-hero .separateur-liens { color: #C6C0B2; margin: 0 8px; }

@media (max-width: 860px) {
    .panel-illustration { display: none; }
    .panel-formulaire { padding: 32px 20px; }
}

/* ============================================================
   StudyNext - Page de garde (connexion / inscription / mdp oublie)
   Design fourni par l'utilisateur, adapte au systeme PHP existant
   ============================================================ */
.page-studynext {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 28px;
    background-image: linear-gradient(rgba(235,246,255,.05), rgba(235,246,255,.05)), url('studynext-background.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: #0a2b69;
}
.login-card {
    width: min(410px, 92vw);
    padding: 30px 31px 28px;
    background: rgba(255,255,255,.94);
    border: 1px solid rgba(255,255,255,.85);
    border-radius: 20px;
    box-shadow: 0 20px 55px rgba(15,52,105,.18);
    backdrop-filter: blur(10px);
    text-align: center;
    animation: entree-studynext .6s ease-out;
}
.login-card .cap { font-size: 48px; line-height: 1; margin-bottom: 3px; filter: saturate(1.25); }
.login-card h1 { margin: 0; font-size: 43px; letter-spacing: -2px; line-height: 1.1; color: #09245c; }
.login-card h1 strong { color: #1d70ff; }
.login-card h1 span, .login-card h1 strong { font-weight: 800; }
.login-card .tagline { margin: 10px 0 6px; font-weight: 700; font-size: 16px; }
.login-card .mini { margin: 0 0 24px; color: #62749a; }
.login-card .mini b { padding: 0 8px; font-weight: 400; }
.login-card .field {
    height: 53px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 12px;
    padding: 0 14px;
    border: 1px solid #ccd7e9;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 5px rgba(21,60,115,.03);
}
.login-card .field:focus-within { border-color: #2b73ff; box-shadow: 0 0 0 3px rgba(43,115,255,.11); }
.login-card .field > span { font-size: 21px; color: #58719d; }
.login-card .field input {
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    font: inherit;
    font-size: 14px;
    color: #102d63;
}
.login-card .field input::placeholder { color: #7081a3; }
.login-card .eye { border: 0; background: transparent; color: #6178a2; font-size: 17px; cursor: pointer; }
.login-card .row { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 14px 1px 20px; font-size: 13px; }
.login-card .remember { display: flex; align-items: center; gap: 5px; font-weight: 600; }
.login-card .remember input { accent-color: #1769ff; }
.login-card .row a { color: #0663ee; text-underline-offset: 2px; }
.login-card .primary, .login-card .secondary {
    display: block;
    width: 100%;
    height: 52px;
    line-height: 52px;
    border-radius: 10px;
    font: inherit;
    font-weight: 750;
    font-size: 15px;
    cursor: pointer;
    text-decoration: none;
    transition: .18s transform, .18s box-shadow, .18s background;
}
.login-card .primary { border: 0; color: white; background: linear-gradient(135deg, #216cf5, #0878ff); box-shadow: 0 9px 18px rgba(20,103,240,.2); }
.login-card .primary:hover { transform: translateY(-1px); box-shadow: 0 12px 23px rgba(20,103,240,.28); }
.login-card .secondary { border: 1.5px solid #1770ff; color: #0962e9; background: white; }
.login-card .secondary:hover { background: #f3f7ff; }
.btn-face-id { margin-top: 10px; }
.login-card .or { display: flex; align-items: center; gap: 13px; margin: 17px 0; color: #6f7f9c; }
.login-card .or span { height: 1px; background: #cbd5e4; flex: 1; }
.login-card .or em { font-style: normal; }
.login-card .message { min-height: 18px; margin: 12px 0 0; font-size: 13px; color: #245ea9; }
.login-card .message.erreur-studynext { color: #C0392B; font-weight: 600; }
@keyframes entree-studynext { from { opacity: 0; transform: translateY(12px) scale(.985); } to { opacity: 1; transform: none; } }
@media (max-width: 650px) {
    .page-studynext { padding: 18px; background-position: center; }
    .login-card { padding: 25px 20px; border-radius: 18px; }
    .login-card h1 { font-size: 37px; }
    .login-card .cap { font-size: 42px; }
    .login-card .row { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
    .login-card { animation: none; }
    .login-card .primary, .login-card .secondary { transition: none; }
}

/* Variante compacte de la carte StudyNext, pour les sous-pages (inscription, mdp oublie, etc.) */
.login-card.compact .marque-compacte {
    font-size: 15px;
    font-weight: 800;
    color: #0a2b69;
    margin: 0 0 18px;
    letter-spacing: -0.3px;
}
.login-card.compact .marque-compacte span { color: #1d70ff; }
.login-card.compact h1 { font-size: 24px; letter-spacing: -0.5px; margin: 0 0 6px; }
.login-card.compact .sous-titre-compact { color: #62749a; font-size: 14px; margin: 0 0 22px; }
.login-card .liens-bas { margin-top: 16px; font-size: 13px; }
.login-card .liens-bas a { color: #0663ee; text-decoration: none; }
.login-card .liens-bas a:hover { text-decoration: underline; }

/* ============================================================
   THEME STUDYNEXT - Tableau de bord (page interieure)
   Reprend l'univers visuel de la page de connexion, sans toucher
   au fonctionnement (les couleurs par matiere restent gerees en JS).
   ============================================================ */
body.page-dashboard {
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    background-color: #F7F2E9;
    background-image: linear-gradient(rgba(247,242,233,.86), rgba(247,242,233,.86)), url('studynext-background.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #0a2b69;
}

body.page-dashboard .bandeau {
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255,255,255,.6);
    box-shadow: 0 2px 12px rgba(15,52,105,.06);
    padding: 14px 20px;
}
body.page-dashboard .marque-bandeau { display: flex; align-items: center; gap: 8px; }
body.page-dashboard .cap-bandeau { font-size: 22px; }
body.page-dashboard .bandeau h1 { font-size: 21px; letter-spacing: -0.5px; color: #09245c; font-weight: 800; }
body.page-dashboard .bandeau .sous { color: #7A879C; }
body.page-dashboard .bandeau h1 strong { color: #1d70ff; font-weight: 800; }
body.page-dashboard .bandeau-boutons button,
body.page-dashboard .bandeau-boutons a {
    border-radius: 10px;
    font-weight: 600;
    border: none;
}
body.page-dashboard .bandeau-boutons button:not(.btn-deconnexion) {
    background: linear-gradient(135deg, #216cf5, #0878ff);
    box-shadow: 0 6px 14px rgba(20,103,240,.22);
}
body.page-dashboard .bandeau-boutons .btn-deconnexion {
    background: white;
    color: #0a2b69;
    border: 1.5px solid #ccd7e9 !important;
}

body.page-dashboard .barre-recherche {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15,52,105,.06);
    margin: 16px 20px 0;
    padding: 10px 12px;
}
body.page-dashboard .barre-recherche input[type="text"] {
    border: 1px solid #E3E9F2;
    border-radius: 10px;
    background: #FCFDFF;
}
body.page-dashboard .barre-recherche input[type="text"]:focus {
    border-color: #2b73ff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(43,115,255,.11);
}
body.page-dashboard .barre-recherche button {
    border-radius: 10px;
    background: linear-gradient(135deg, #216cf5, #0878ff);
    border: none;
    font-weight: 600;
}
body.page-dashboard .barre-recherche .btn-effacer { background: #B7BFCF; }

body.page-dashboard .corps { padding: 16px 20px 40px; gap: 20px; }

body.page-dashboard .colonne-gauche {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(15,52,105,.07);
    padding: 16px;
}
body.page-dashboard .boutons-matiere-cours { gap: 8px; }
body.page-dashboard .btn-matiere,
body.page-dashboard .btn-cours {
    border-radius: 10px;
    font-weight: 700;
    border: none;
    box-shadow: 0 6px 14px rgba(15,52,105,.12);
}
body.page-dashboard .btn-matiere { background: linear-gradient(135deg, #216cf5, #0878ff); }
body.page-dashboard .btn-cours { background: linear-gradient(135deg, #1fae9a, #0e8f7d); }

body.page-dashboard .arbre .nom-matiere {
    border-radius: 10px;
    padding: 10px 10px;
    font-weight: 700;
    transition: background .15s;
}
body.page-dashboard .arbre .nom-matiere:hover { background: rgba(43,115,255,.06); }
body.page-dashboard .arbre .nom-cours {
    border-radius: 8px;
    padding: 8px 10px;
    font-weight: 500;
    transition: background .15s;
}
body.page-dashboard .arbre .nom-cours:hover { background: rgba(43,115,255,.06); }

body.page-dashboard .colonne-droite { min-width: 0; }
body.page-dashboard .entete-droite {
    background: rgba(255,255,255,.88);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15,52,105,.06);
    padding: 14px 16px;
    margin-bottom: 14px;
}
body.page-dashboard .fil-ariane { color: #09245c; }
body.page-dashboard .btn-nouveau-chapitre {
    border-radius: 10px;
    font-weight: 700;
    border: none;
    background: linear-gradient(135deg, #216cf5, #0878ff) !important;
    box-shadow: 0 6px 14px rgba(20,103,240,.22);
}
body.page-dashboard .btn-nouveau-chapitre:disabled {
    background: #C7CEDB !important;
    box-shadow: none;
}

body.page-dashboard .message-vide {
    background: rgba(255,255,255,.88);
    border-radius: 14px;
    padding: 30px;
    text-align: center;
    color: #62749a;
}

body.page-dashboard .carte-chapitre {
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(15,52,105,.08);
    border-width: 0;
    margin-bottom: 14px;
}
body.page-dashboard .carte-entete { padding: 14px 16px; }
body.page-dashboard .carte-titre { font-weight: 700; }
body.page-dashboard .carte-boutons button,
body.page-dashboard .badge-revise {
    border-radius: 8px;
    font-weight: 600;
    border: none;
}
body.page-dashboard .carte-corps { padding: 18px; }

body.page-dashboard .onglets button {
    border-radius: 999px;
    padding: 9px 16px;
    font-weight: 600;
    border: 1px solid rgba(10,43,105,.1);
}
body.page-dashboard .onglets button.actif { border-color: transparent; }

body.page-dashboard .zone-onglet textarea {
    border-radius: 10px;
    border: 1px solid #E3E9F2;
    background: #FCFDFF;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
body.page-dashboard .zone-onglet textarea:focus {
    outline: none;
    border-color: #2b73ff;
    box-shadow: 0 0 0 3px rgba(43,115,255,.11);
}

body.page-dashboard .zone-documents {
    background: #FCFDFF;
    border-radius: 10px;
    border: 1px solid #E3E9F2;
}
body.page-dashboard .btn-ajouter-doc {
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(15,52,105,.14);
}
body.page-dashboard .doc-vignette {
    border-radius: 8px;
}

body.page-dashboard .modal-note {
    border-radius: 16px;
    box-shadow: 0 20px 55px rgba(15,52,105,.22);
}
body.page-dashboard .btn-violet {
    background: linear-gradient(135deg, #216cf5, #0878ff);
}
body.page-dashboard .btn-gris {
    background: white;
    color: #0a2b69;
    border: 1.5px solid #ccd7e9;
}

@media (max-width: 930px) {
    body.page-dashboard .corps { padding: 12px; gap: 12px; }
    body.page-dashboard .barre-recherche { margin: 12px 12px 0; }
}

/* ============================================================
   AJUSTEMENTS - Typographie plus fine + badges plus sobres
   ============================================================ */
body.page-dashboard { font-size: 14.5px; }
body.page-dashboard .arbre .nom-matiere { font-size: 14px; font-weight: 600; }
body.page-dashboard .arbre .nom-cours { font-size: 13.5px; font-weight: 500; }
body.page-dashboard .fil-ariane { font-size: 16px; font-weight: 600; }
body.page-dashboard .carte-titre { font-size: 14px; font-weight: 600; }
body.page-dashboard .onglets button { font-size: 12.5px; padding: 8px 13px; }
body.page-dashboard .btn-nouveau-chapitre { font-size: 12.5px; padding: 10px 16px; }
body.page-dashboard .btn-matiere, body.page-dashboard .btn-cours { font-size: 13px; }
body.page-dashboard .carte-boutons button, body.page-dashboard .badge-revise { font-size: 11px; }
body.page-dashboard .badge-revise.oui { background: #5A9179 !important; }
body.page-dashboard .badge-revise.non { background: #B98A3D !important; }

/* ============================================================
   EDITEUR DE TEXTE ENRICHI (remplace les anciens textarea)
   ============================================================ */
.editeur-riche {
    border: 1px solid #D7DEE8;
    border-radius: 10px;
    overflow: hidden;
    background: #FCFDFF;
}
.barre-outils-editeur {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    padding: 6px 8px;
    background: #F1F4F9;
    border-bottom: 1px solid #E3E9F2;
}
.outil-editeur {
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    padding: 5px 9px;
    font-size: 13px;
    cursor: pointer;
    color: #3A4A6B;
}
.outil-editeur:hover { background: rgba(10,43,105,.08); }
.outil-taille { font-size: 12px; padding: 4px 6px; }
.outil-couleur {
    width: 30px;
    height: 28px;
    padding: 2px;
    border: 1px solid #D7DEE8;
    border-radius: 6px;
    cursor: pointer;
    background: white;
}
.outil-texte { font-size: 11.5px; }
.zone-texte-riche {
    width: 100%;
    min-height: calc(100vh - 380px);
    padding: 12px;
    outline: none;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
    overflow-y: auto;
}
@media (max-width: 930px) {
    .zone-texte-riche { min-height: 220px; }
}

/* ---------- Palettes de couleurs directes (editeur riche) ---------- */
.enveloppe-palette { position: relative; }
.palette-couleurs {
    display: none;
    position: absolute;
    top: 110%;
    left: 0;
    z-index: 20;
    background: white;
    border: 1px solid #D7DEE8;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(15,52,105,.16);
    padding: 8px;
    gap: 6px;
    flex-wrap: wrap;
    width: 150px;
}
.pastille-couleur {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,.12);
    cursor: pointer;
    padding: 0;
}
.pastille-couleur:hover { transform: scale(1.12); }
.pastille-aucune {
    background-image: linear-gradient(to top right, transparent 47%, #C0392B 48%, #C0392B 52%, transparent 53%);
}

/* ---------- Statistiques admin (en ligne, comptes, actifs 24h) ---------- */
.stats-admin {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.stat-case {
    flex: 1;
    min-width: 140px;
    text-align: center;
    padding: 14px 10px;
    background: #F7F9FC;
    border-radius: 10px;
}
.stat-nombre {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: #2C3E63;
}
.stat-label {
    display: block;
    font-size: 12.5px;
    color: #7A879C;
    margin-top: 2px;
}
.note-discrete {
    font-size: 12.5px;
    color: #8A93A3;
    margin: -6px 0 10px;
}
.form-email-prive textarea {
    width: 100%;
    padding: 8px;
    border: 1px solid #D7DEE8;
    border-radius: 8px;
    font-family: inherit;
    resize: vertical;
}
.form-email-prive {
    flex-direction: column;
    align-items: stretch;
}
.form-email-prive input[type="text"] {
    width: 100%;
}
.form-email-prive textarea {
    min-height: 90px;
}
.form-email-prive button {
    align-self: flex-end;
}

/* ---------- Bandeau d'annonce du site ---------- */
.bandeau-annonce {
    background: #FFF3CD;
    color: #6B5A2E;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    padding: 12px 20px;
    border-bottom: 2px solid #F0D98C;
}

/* ============================================================
   TABLEAU DE BORD ADMIN - reorganisation (stats en haut, sections repliables)
   ============================================================ */
body.page-dashboard.page-admin .carte-admin {
    background: rgba(255,255,255,.9);
    backdrop-filter: blur(8px);
    border-radius: 14px;
    box-shadow: 0 8px 22px rgba(15,52,105,.08);
    margin-bottom: 16px;
    padding: 18px 20px;
}
body.page-dashboard.page-admin .corps-admin {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px 16px 50px;
}

.bandeau-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.pastille-stat {
    background: rgba(10,43,105,.08);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12.5px;
    color: #0a2b69;
}
.pastille-stat strong { font-size: 14px; }
.pastille-cliquable { cursor: pointer; transition: .15s background; }
.pastille-cliquable:hover { background: rgba(10,43,105,.16); }

.modale-fond {
    position: fixed;
    inset: 0;
    background: rgba(15,32,66,.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modale-boite {
    background: white;
    border-radius: 14px;
    max-width: 360px;
    width: 100%;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 55px rgba(15,52,105,.25);
    overflow: hidden;
}
.modale-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #ECE4D4;
}
.modale-entete h3 { margin: 0; font-size: 16px; color: #0a2b69; }
.modale-fermer {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: #7a8aa8;
    cursor: pointer;
    padding: 0 4px;
}
.modale-fermer:hover { color: #0a2b69; }
.modale-corps { padding: 16px 20px; overflow-y: auto; color: #2C3E63; font-size: 14px; }
.liste-en-ligne { list-style: none; margin: 0; padding: 0; }
.liste-en-ligne li {
    padding: 9px 0;
    border-bottom: 1px solid #F0EBDD;
}
.liste-en-ligne li:last-child { border-bottom: none; }
.liste-en-ligne li::before { content: "🟢 "; }

.carte-repliable h2 {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
    margin-bottom: 0;
}
.carte-repliable h2:hover { color: #0878ff; }
.chevron-section { font-size: 13px; color: #8A93A3; }
.contenu-repliable { margin-top: 14px; }

/* ---------- Bouton "Contacter l'administrateur" ---------- */
.btn-contact-admin {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 999px;
    background: white;
    color: #0878ff;
    border: 1.5px solid #0878ff;
    font-weight: 600;
    font-size: 13px;
    text-decoration: none;
    transition: background .15s, color .15s;
}
.btn-contact-admin:before { content: "\2709"; }
.btn-contact-admin:hover { background: #0878ff; color: white; }

/* ---------- Messages de contact (console admin) ---------- */
.pastille-alerte {
    background: #FDECEA;
    color: #C0392B;
    font-weight: 700;
}
.badge-non-lu {
    display: inline-block;
    background: #C0392B;
    color: white;
    border-radius: 999px;
    padding: 1px 9px;
    font-size: 12px;
    margin-left: 6px;
}
.ligne-message {
    border-top: 1px solid #EEE;
    padding: 12px 0;
}
.ligne-message-non-lu { background: #FFFBEA; margin: 0 -20px; padding: 12px 20px; }
.texte-message {
    background: #F7F9FC;
    border-radius: 8px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 14px;
    white-space: pre-wrap;
}

/* ---------- Barre de progression de revision par matiere ---------- */
.barre-progres-matiere-conteneur {
    height: 5px;
    background: #EAEEF5;
    border-radius: 3px;
    margin: 2px 10px 6px;
    overflow: hidden;
}
.barre-progres-matiere {
    height: 100%;
    border-radius: 3px;
    transition: width .3s;
}

/* ---------- Bandeau de rappel de revision (chapitres non revises) ---------- */
.bandeau-rappel-revision {
    background: #E9F1FF;
    color: #0a2b69;
    padding: 10px 20px;
    font-size: 13px;
    text-align: center;
    border-bottom: 1px solid #CFE0FA;
}
.puce-rappel {
    display: inline-block;
    background: white;
    border-radius: 999px;
    padding: 3px 12px;
    margin: 2px 4px;
    font-weight: 600;
    font-size: 12.5px;
}

.btn-tester { width: 100%; }
.bandeau-mode-test {
    background: #0a2b69;
    color: white;
    text-align: center;
    padding: 8px 14px;
    font-size: 13px;
}
.bandeau-mode-test a { color: #9cc4ff; margin-left: 10px; font-weight: bold; }


/* ============================================================
   BLOC-NOTES (POST-IT) : bouton dans la barre + fenetre flottante
   ============================================================ */
.btn-postit {
    background: #ffe45c;
    color: #5a4700;
    border: 0;
    border-radius: 10px;
    padding: 9px 14px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 10px rgba(180,150,0,.25);
}
.btn-postit:hover, .btn-postit.actif { background: #ffd21f; }
.btn-postit-icone { font-size: 17px; line-height: 1; }
@media (max-width: 480px) {
    .btn-postit { padding: 8px 10px; }
    .btn-postit-texte { display: none; }
}

.postit {
    position: fixed;
    display: none;
    flex-direction: column;
    z-index: 90;
    min-width: 260px;
    min-height: 300px;
    background: #fff;
    border: 1px solid #e0cf6a;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(15,52,105,.28);
    overflow: hidden;
    color: #0a2b69;
}
.postit.ouvert { display: flex; }
.postit.pi-plein {
    left: 0 !important; top: 0 !important;
    width: 100% !important; height: 100% !important;
    border-radius: 0;
}
.postit.pi-plein .pi-poignee { display: none; }

.pi-entete {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 7px 8px 7px 12px;
    background: #fff3a3;
    border-bottom: 1px solid #e0cf6a;
    cursor: move;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.postit.pi-plein .pi-entete { cursor: default; }
.pi-titre-fenetre { font-weight: 800; font-size: 14px; color: #5a4700; }
.pi-entete-boutons { display: flex; gap: 4px; }

.pi-btn {
    background: #fff;
    color: #0a2b69;
    border: 1px solid #d6dbe6;
    border-radius: 8px;
    padding: 5px 9px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
    font-family: inherit;
}
.pi-btn:hover { background: #f3f7ff; }
.pi-btn.actif { background: #e3edff; border-color: #1d70ff; color: #0a4fd1; }
.pi-btn.pi-primaire { background: linear-gradient(135deg, #216cf5, #0878ff); color: #fff; border-color: transparent; }
.pi-btn.pi-primaire:hover { filter: brightness(1.08); }

.pi-vue { flex: 1; min-height: 0; flex-direction: column; }
.pi-vue-editeur { display: flex; }
.pi-vue-archive { display: none; }
.postit.pi-archive-ouverte .pi-vue-editeur { display: none; }
.postit.pi-archive-ouverte .pi-vue-archive { display: flex; }

/* barre d'outils */
.pi-outils {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px 8px;
    background: #fffbe0;
    border-bottom: 1px solid #f0e6a0;
}
.pi-ligne { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.pi-groupe { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.pi-pousse { margin-left: auto; }
.pi-outils-dessin { display: none; }
.postit.pi-mode-dessin .pi-outils-dessin { display: flex; flex-direction: column; gap: 6px; }
.postit.pi-mode-dessin .pi-outils-texte { display: none; }
.pi-epaisseur { display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 28px; padding: 0 6px; }
.pi-epaisseur i { display: inline-block; background: #1f2937; border-radius: 50%; }
.pi-couleurs { gap: 5px; }
.pi-couleurs { gap: 5px; }
.pi-pastille {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-shadow: 0 0 0 1px #b8c2d4;
    padding: 0;
    cursor: pointer;
}
.pi-pastille.actif { box-shadow: 0 0 0 3px #1d70ff; }
@media (pointer: coarse) {
    .pi-pastille { width: 28px; height: 28px; }
    .pi-btn { padding: 7px 10px; }
}

.pi-titre {
    border: 0;
    border-bottom: 1px solid #eceff5;
    padding: 8px 12px;
    font-size: 16px;
    font-weight: 700;
    color: #0a2b69;
    outline: none;
    font-family: inherit;
    background: #fff;
}
.pi-titre::placeholder { color: #9aa5b8; font-weight: 500; }

/* zone d'ecriture : le texte dessous, le dessin par-dessus */
.pi-zone {
    flex: 1;
    min-height: 0;
    overflow: auto;
    display: flex;
    flex-direction: column;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}
.pi-page {
    position: relative;
    display: flex;
    flex: 1 0 auto;
    min-height: var(--pi-hmin, 0px);
}
.pi-texte {
    flex: 1;
    min-width: 0;
    min-height: 120px;
    padding: 10px 12px 40px;
    font-size: 16px;
    line-height: 1.5;
    color: #1f2937;
    outline: none;
    overflow-wrap: anywhere;
    font-family: inherit;
}
.pi-texte:empty:before { content: attr(data-placeholder); color: #9aa5b8; pointer-events: none; }
.pi-dessin {
    position: absolute;
    left: 0; top: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    touch-action: none;
}
.postit.pi-mode-dessin .pi-dessin { pointer-events: auto; cursor: crosshair; }
.postit.pi-mode-dessin .pi-dessin.pi-gomme { cursor: cell; }

.pi-pied {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 6px 34px 6px 8px;
    border-top: 1px solid #eceff5;
    background: #fafbfd;
}
.pi-pied #piBtnEnregistrer { margin-left: auto; }
.pi-statut { order: -1; flex: 1 0 100%; font-size: 12px; color: #6b7a99; min-width: 0; }
.pi-statut:empty { display: none; }
.pi-statut.pi-erreur { color: #c0392b; font-weight: 600; }

/* poignee pour agrandir / reduire (coin bas droite) */
.pi-poignee {
    position: absolute;
    right: 0; bottom: 0;
    width: 30px; height: 30px;
    cursor: nwse-resize;
    touch-action: none;
    z-index: 5;
    background:
        linear-gradient(135deg, transparent 0 52%, #b8a84a 52% 60%, transparent 60% 70%, #b8a84a 70% 78%, transparent 78%);
    border-bottom-right-radius: 12px;
}

/* archive */
.pi-archive-haut { display: flex; gap: 6px; padding: 8px; }
.pi-archive-haut input {
    flex: 1;
    min-width: 0;
    border: 1px solid #ccd7e9;
    border-radius: 8px;
    padding: 7px 10px;
    font-size: 16px;
    font-family: inherit;
}
.pi-compteur { padding: 0 10px 6px; font-size: 12px; color: #6b7a99; }
.pi-liste { flex: 1; min-height: 0; overflow: auto; border-top: 1px solid #eceff5; -webkit-overflow-scrolling: touch; }
.pi-note { display: flex; align-items: stretch; border-bottom: 1px solid #eef0f5; }
.pi-note-ouvrir {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    background: none;
    border: 0;
    padding: 9px 10px;
    cursor: pointer;
    font-family: inherit;
    color: #0a2b69;
}
.pi-note-ouvrir:hover { background: #f6f9ff; }
.pi-note-ouvrir strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-note-date { font-size: 11px; color: #8a96ad; }
.pi-note-apercu { font-size: 12px; color: #5d6b88; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-note-suppr { background: none; border: 0; padding: 0 12px; cursor: pointer; font-size: 16px; opacity: .55; }
.pi-note-suppr:hover { opacity: 1; background: #fdeeee; }
.pi-vide { padding: 18px 12px 8px; color: #6b7a99; font-size: 14px; margin: 0; }
.pi-lien { display: inline-block; margin: 0 12px 12px; color: #0663ee; font-weight: 700; }

/* couleur libre : une pastille arc-en-ciel qui ouvre le selecteur du navigateur */
.pi-libre {
    position: relative;
    display: inline-block;
    cursor: pointer;
    background: conic-gradient(#ef4444, #facc15, #22c55e, #06b6d4, #3b82f6, #a855f7, #ef4444);
}
.pi-libre input[type="color"] {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
    border: 0; padding: 0;
}
.pi-dessin.pi-remplir { cursor: copy; }
.pi-pied [hidden] { display: none; }

/* barre d'outils plus compacte + possibilite de la masquer */
.pi-outils .pi-btn { padding: 5px 6px; font-size: 12.5px; }
.pi-outils .pi-mode, .pi-outils #piAnnuler, .pi-outils #piRefaire { padding: 5px 9px; font-size: 13px; }
.postit.pi-outils-masques .pi-outils { display: none; }
.pi-pied .pi-btn { padding: 5px 8px; }

.pi-outils .pi-pastille { width: 20px; height: 20px; }
.pi-outils .pi-couleurs { gap: 4px; }
@media (pointer: coarse) { .pi-outils .pi-pastille { width: 26px; height: 26px; } }

.pi-dessin.pi-selection { cursor: move; }

/* zoom du dessin */
.pi-zone-boite { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.pi-zoom {
    position: absolute;
    top: 8px; right: 18px;
    display: none;
    gap: 4px;
    padding: 4px;
    background: rgba(255,255,255,.94);
    border: 1px solid #d6dbe6;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(15,52,105,.15);
    z-index: 3;
}
.postit.pi-mode-dessin .pi-zoom { display: flex; }
.pi-zoom .pi-btn { min-width: 34px; padding: 4px 8px; font-size: 14px; }
.pi-zoom #piZoomVal { min-width: 58px; font-size: 12.5px; }

/* outil main (deplacer la feuille) et palette de motifs */
.pi-dessin.pi-main { cursor: grab; }
.pi-tampons {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 5px 8px;
    border-top: 1px solid #eceff5;
    background: #f7f9fc;
}
.pi-tampons[hidden] { display: none; }
.pi-motif {
    flex: 0 0 auto;
    width: 38px; height: 38px;
    padding: 0;
    font-size: 23px;
    line-height: 1;
    background: #fff;
    border: 1.5px solid #d6dbe6;
    border-radius: 9px;
    cursor: pointer;
    font-family: "Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji","Segoe UI Symbol",sans-serif;
}
.pi-motif.actif { border-color: #1d70ff; background: #e8f0ff; box-shadow: 0 0 0 2px rgba(29,112,255,.25); }
.pi-motif-symbole { color: #1f2937; font-size: 21px; }
.pi-outils #piRefaire { margin-left: 4px; }

/* baguette magique */
.pi-baguette {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-top: 1px solid #eceff5;
    background: #f7f9fc;
    font-size: 12.5px;
    font-weight: 600;
    color: #1f3c68;
}
.pi-baguette[hidden] { display: none; }
.pi-baguette label { display: flex; align-items: center; gap: 6px; }
.pi-baguette input[type=range] { width: 110px; }

/* calque des photos : sous le texte, pour pouvoir ecrire dessus */
.pi-fondimg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.pi-texte { position: relative; z-index: 1; }
.pi-dessin { z-index: 2; }

/* zone de texte : editeur en bas de la feuille */
.pi-edittexte {
    display: flex;
    gap: 6px;
    padding: 6px 8px;
    border-top: 1px solid #eceff5;
    background: #f7f9fc;
}
.pi-edittexte[hidden] { display: none; }
.pi-edittexte textarea {
    flex: 1;
    min-width: 0;
    resize: none;
    font: inherit;
    font-size: 16px;
    padding: 6px 8px;
    border: 1.5px solid #d6dbe6;
    border-radius: 8px;
}
.pi-edittexte-btns { display: flex; flex-direction: column; gap: 6px; }
