/* Mémo — feuille de style unique, sans dépendance externe. */

:root {
    --fond: #e3e7ea;
    --fond-trait: #d2d8dd;
    --encre: #1d2a32;
    --encre-doux: #5b6b76;
    --encre-tres-doux: #8494a0;
    --trait: #c4ccd3;
    --accent: #2a6b4f;
    --accent-sombre: #1f5039;
    --accent-pale: #e0ece5;
    --retard: #a63a1e;
    --retard-pale: #f6e4de;
    --surface: #ffffff;
    --rayon: 3px;
    --ombre-papier: 0 1px 1px rgba(29, 42, 50, .10), 0 6px 14px -6px rgba(29, 42, 50, .28);
}

/* Papiers */
.n-jaune  { --papier: #ffe9a0; --papier-bas: #f5d97f; }
.n-rose   { --papier: #ffd2dc; --papier-bas: #f6b6c5; }
.n-bleu   { --papier: #c6e2f5; --papier-bas: #a5cfec; }
.n-vert   { --papier: #cfeab6; --papier-bas: #b3d795; }
.n-mauve  { --papier: #e0d0f2; --papier-bas: #c9b4e4; }
.n-blanc  { --papier: #fdfdf8; --papier-bas: #ececdf; }

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--encre);
    background-color: var(--fond);
    background-image:
        linear-gradient(var(--fond-trait) 1px, transparent 1px),
        linear-gradient(90deg, var(--fond-trait) 1px, transparent 1px);
    background-size: 28px 28px;
}

a { color: var(--accent-sombre); }

:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Barre du haut ---------- */

.barre {
    background: var(--encre);
    color: #eef2f4;
    padding: .7rem 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: .5rem 1.25rem;
}

.barre-titre {
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: -.01em;
    margin: 0;
    color: #fff;
}

.barre-titre span {
    font-weight: 400;
    color: #9fb0ba;
}

.barre-liens {
    margin-left: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 1rem;
    font-size: .875rem;
}

.barre-liens a { color: #cdd8de; text-decoration: none; }
.barre-liens a:hover { color: #fff; text-decoration: underline; }
.barre-moi { color: #9fb0ba; }

/* ---------- Conteneur ---------- */

.page {
    max-width: 1180px;
    margin: 0 auto;
    padding: 1.5rem 1.25rem 4rem;
}

.page-etroite {
    max-width: 560px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem 4rem;
}

/* ---------- Onglets de tri ---------- */

.entete-tableau {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--trait);
}

.onglets {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.onglets a {
    display: block;
    padding: .5rem .8rem;
    text-decoration: none;
    color: var(--encre-doux);
    font-size: .95rem;
    border-bottom: 3px solid transparent;
    margin-bottom: -1px;
}

.onglets a:hover { color: var(--encre); }

.onglets a[aria-current="page"] {
    color: var(--encre);
    font-weight: 600;
    border-bottom-color: var(--accent);
}

.compteur {
    display: inline-block;
    min-width: 1.35em;
    margin-left: .35rem;
    padding: 0 .35em;
    border-radius: 999px;
    background: var(--trait);
    color: var(--encre);
    font-size: .75rem;
    font-weight: 600;
    text-align: center;
    vertical-align: 1px;
}

.onglets a[aria-current="page"] .compteur { background: var(--accent); color: #fff; }
.compteur-alerte { background: var(--retard); color: #fff; }

.entete-actions { margin-left: auto; padding-bottom: .5rem; }

/* ---------- Boutons ---------- */

.bouton {
    display: inline-block;
    font: inherit;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.2;
    padding: .6rem 1rem;
    border: 1px solid var(--accent);
    border-radius: var(--rayon);
    background: var(--accent);
    color: #fff;
    text-decoration: none;
    cursor: pointer;
}

.bouton:hover { background: var(--accent-sombre); border-color: var(--accent-sombre); }

.bouton-secondaire {
    background: var(--surface);
    color: var(--encre);
    border-color: var(--trait);
}

.bouton-secondaire:hover { background: #f2f5f6; border-color: var(--encre-tres-doux); }

.bouton-danger { background: var(--retard); border-color: var(--retard); }
.bouton-danger:hover { background: #8b2f16; border-color: #8b2f16; }

/* ---------- Mur de mémos ---------- */

.mur {
    columns: 4 250px;
    column-gap: 1.25rem;
}

.memo {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    margin: 0 0 1.25rem;
    padding: 1.75rem 1.1rem .9rem;
    background: linear-gradient(178deg, var(--papier, #ffe9a0) 82%, var(--papier-bas, #f5d97f));
    box-shadow: var(--ombre-papier);
    position: relative;
}

.memo:nth-child(4n+1) { transform: rotate(-.7deg); }
.memo:nth-child(4n+2) { transform: rotate(.5deg); }
.memo:nth-child(4n+3) { transform: rotate(-.3deg); }
.memo:nth-child(4n+4) { transform: rotate(.8deg); }

.memo::before {
    content: "";
    position: absolute;
    top: 9px;
    left: 50%;
    width: 11px;
    height: 11px;
    margin-left: -5.5px;
    border-radius: 50%;
    background: #7e8d97;
    box-shadow: inset 0 -2px 2px rgba(0, 0, 0, .25), 0 1px 2px rgba(0, 0, 0, .3);
}

.memo-retard::before { background: var(--retard); }
.memo-urgent::before { background: #d97b16; }

.memo-titre {
    margin: .2rem 0 .5rem;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -.01em;
    line-height: 1.3;
}

.memo-texte {
    margin: 0 0 .9rem;
    font-size: .95rem;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

.memo-meta {
    font-size: .8rem;
    color: #4a5a64;
    border-top: 1px solid rgba(29, 42, 50, .18);
    padding-top: .55rem;
    display: flex;
    flex-wrap: wrap;
    gap: .2rem .6rem;
    align-items: baseline;
}

.memo-pour { font-weight: 600; color: var(--encre); }

.memo-echeance { font-weight: 600; }
.memo-echeance.retard { color: var(--retard); }
.memo-echeance.urgent { color: #9a5a0a; }

.memo-boutons {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: .7rem;
}

.memo-boutons form { margin: 0; }

.memo-boutons button,
.memo-boutons a {
    font: inherit;
    font-size: .8rem;
    padding: .3rem .6rem;
    border: 1px solid rgba(29, 42, 50, .3);
    border-radius: var(--rayon);
    background: rgba(255, 255, 255, .55);
    color: var(--encre);
    text-decoration: none;
    cursor: pointer;
}

.memo-boutons button:hover,
.memo-boutons a:hover { background: #fff; border-color: var(--encre); }

.memo-fait {
    transform: rotate(0deg) !important;
    opacity: .62;
    box-shadow: 0 1px 2px rgba(29, 42, 50, .12);
}

.memo-fait::before { background: var(--accent); }
.memo-fait .memo-titre { text-decoration: line-through; }

/* ---------- États vides et messages ---------- */

.vide {
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    padding: 2.5rem 1.5rem;
    text-align: center;
    color: var(--encre-doux);
}

.vide p { margin: 0 0 1rem; }

.message {
    padding: .8rem 1rem;
    border-radius: var(--rayon);
    border: 1px solid var(--accent);
    background: var(--accent-pale);
    color: var(--accent-sombre);
    margin-bottom: 1.25rem;
    font-size: .95rem;
}

.message-erreur {
    border-color: var(--retard);
    background: var(--retard-pale);
    color: var(--retard);
}

.message code {
    font-size: 1.05em;
    font-weight: 700;
    background: rgba(255, 255, 255, .7);
    padding: .05em .35em;
    border-radius: 2px;
}

/* ---------- Formulaires et cartons ---------- */

.carton {
    background: var(--surface);
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    padding: 1.75rem;
    box-shadow: 0 1px 2px rgba(29, 42, 50, .06);
}

.carton h1 {
    margin: 0 0 .35rem;
    font-size: 1.5rem;
    letter-spacing: -.02em;
}

.carton h2 {
    margin: 0 0 1rem;
    font-size: 1.15rem;
    letter-spacing: -.01em;
}

.sous-titre {
    margin: 0 0 1.5rem;
    color: var(--encre-doux);
    font-size: .95rem;
}

.champ { margin-bottom: 1.1rem; }

.champ label {
    display: block;
    margin-bottom: .3rem;
    font-size: .9rem;
    font-weight: 600;
}

.champ .aide {
    display: block;
    margin-top: .3rem;
    font-size: .82rem;
    font-weight: 400;
    color: var(--encre-doux);
}

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
select,
textarea {
    width: 100%;
    font: inherit;
    font-size: 1rem;
    padding: .55rem .65rem;
    border: 1px solid var(--encre-tres-doux);
    border-radius: var(--rayon);
    background: #fff;
    color: var(--encre);
}

textarea { min-height: 8rem; resize: vertical; line-height: 1.5; }

input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.ligne-champs {
    display: flex;
    flex-wrap: wrap;
    gap: 1.1rem;
}

.ligne-champs .champ { flex: 1 1 12rem; }

/* Choix de couleur du papier */

.couleurs {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.couleurs legend {
    padding: 0;
    margin-bottom: .3rem;
    font-size: .9rem;
    font-weight: 600;
}

.couleur-choix { position: relative; }

.couleur-choix input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    cursor: pointer;
}

.couleur-choix span {
    display: block;
    padding: .45rem .8rem;
    font-size: .85rem;
    border: 2px solid transparent;
    border-radius: var(--rayon);
    background: var(--papier);
    box-shadow: inset 0 0 0 1px rgba(29, 42, 50, .15);
}

.couleur-choix input:checked + span { border-color: var(--encre); font-weight: 700; }
.couleur-choix input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

.case-a-cocher {
    display: flex;
    align-items: flex-start;
    gap: .55rem;
    font-weight: 400;
    cursor: pointer;
}

.case-a-cocher input[type="checkbox"] {
    width: 1.15rem;
    height: 1.15rem;
    margin: .15rem 0 0;
    flex: none;
    accent-color: var(--accent);
    cursor: pointer;
}

.case-a-cocher span { font-weight: 600; }

.actions-formulaire {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--trait);
}

.actions-formulaire .lien-annuler {
    color: var(--encre-doux);
    font-size: .9rem;
}

/* ---------- Tableau des membres ---------- */

.tableau {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

.tableau th,
.tableau td {
    text-align: left;
    padding: .6rem .5rem;
    border-bottom: 1px solid var(--trait);
    vertical-align: middle;
}

.tableau th {
    font-size: .82rem;
    color: var(--encre-doux);
    font-weight: 600;
}

.tableau tr:last-child td { border-bottom: 0; }

.etiquette {
    display: inline-block;
    padding: .1rem .45rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 600;
    background: var(--accent-pale);
    color: var(--accent-sombre);
}

.etiquette-inactif { background: #e6e9eb; color: var(--encre-doux); }

.actions-ligne {
    display: flex;
    flex-wrap: wrap;
    gap: .35rem;
}

.actions-ligne button {
    font: inherit;
    font-size: .8rem;
    padding: .25rem .55rem;
    border: 1px solid var(--trait);
    border-radius: var(--rayon);
    background: #fff;
    cursor: pointer;
    color: var(--encre);
}

.actions-ligne button:hover { border-color: var(--encre); }

.section-espacee { margin-top: 2.5rem; }

/* ---------- Divers ---------- */

.pied {
    margin-top: 3rem;
    text-align: center;
    font-size: .82rem;
    color: var(--encre-doux);
}

@media (max-width: 640px) {
    .mur { columns: 1; }
    .memo { transform: none !important; }
    .entete-actions { margin-left: 0; width: 100%; }
    .entete-actions .bouton { width: 100%; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; animation: none !important; }
}
