/* ------------------------------------------------------------------
   Charte du site — dérivée du blason familial
   Azur #2b5df2, or #fcef3c, gueules #e20909, argent, sable.
   Les teintes vives de l'héraldique sont assourdies pour l'écran :
   on garde les couleurs, on abaisse la saturation pour la lisibilité.
   ------------------------------------------------------------------ */
:root {
    --argent:      #f4f2ee;   /* fond général */
    --surface:     #ffffff;
    --sable:       #1c1b1f;   /* encre */
    --sable-doux:  #63616b;
    --line:        #e2ded6;

    --azur:        #234ea8;   /* accent principal */
    --azur-fonce:  #1a3a7d;
    --azur-clair:  #edf1fa;
    --or:          #c9a227;   /* filets et accents */
    --or-clair:    #fbf3d9;
    --gueules:     #b3241c;   /* alertes, suppression */
    --gueules-clair:#fbeceb;

    --radius: 10px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--argent);
    color: var(--sable);
    font: 16px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

h1 { font-size: 1.6rem; margin: 0 0 .25rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
a  { color: var(--azur-fonce); }

/* --- Barre de navigation : filet d'or sous l'azur, comme la bande du blason --- */
.topbar {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: inset 0 -4px 0 var(--or);
    padding: .8rem 1.25rem .95rem;
}
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: 1.05rem; color: var(--sable); text-decoration: none; }
.brand img { height: 37px; width: auto; display: block; }
.nav { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav a { color: var(--sable-doux); text-decoration: none; padding: .2rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--sable); }
.nav a.is-active { color: var(--azur-fonce); border-bottom-color: var(--azur); }

.container { max-width: 960px; margin: 0 auto; padding: 1.75rem 1.25rem 3rem; }
.footer { text-align: center; color: var(--sable-doux); font-size: .82rem; padding: 1rem; }

/* --- Pages publiques : le blason en majesté --- */
body.guest { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100vh; padding: 2rem 1rem; }
.crest { width: 96px; height: auto; display: block; margin: 0 auto .9rem; }
.card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    border-top: 4px solid var(--azur);
    padding: 2rem; width: min(430px, 94vw);
}
.card-title { font-size: 1.15rem; text-align: center; font-weight: 600; margin: 0 0 1.4rem; letter-spacing: -.01em; }
.card-title::after {
    content: ""; display: block; width: 46px; height: 3px; margin: .55rem auto 0;
    background: var(--or); border-radius: 2px;
}

/* --- Blocs --- */
.panel {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 1.25rem; margin-bottom: 1.25rem;
}
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

/* --- Formulaires --- */
.form label { display: block; font-size: .85rem; font-weight: 600; margin: .9rem 0 .3rem; }
.form input[type=text], .form input[type=email], .form input[type=password],
.form input[type=date], .form input[type=time], .form input[type=tel],
.form input[type=search], .form select, .form textarea {
    width: 100%; padding: .6rem .7rem; font-size: 1rem; color: var(--sable);
    font-family: inherit;
    background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.form textarea { resize: vertical; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--azur); outline-offset: 1px; border-color: var(--azur); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid .form-actions { grid-column: 1 / -1; margin-top: 1.25rem; display: flex; gap: .6rem; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 400 !important; margin-top: 1rem !important; }
.checkbox input { width: auto; accent-color: var(--azur); }
.hint { color: var(--sable-doux); font-size: .8rem; margin: .35rem 0 0; }
.field-error { color: var(--gueules); font-size: .82rem; margin: .3rem 0 0; }
.search { display: flex; gap: .5rem; margin-bottom: 1rem; }
.search input { flex: 1; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: 8px; font-size: .95rem; }

/* --- Boutons --- */
.btn {
    display: inline-block; padding: .55rem 1rem; font-size: .92rem; font-weight: 500;
    border: 1px solid var(--line); border-radius: 8px; background: var(--surface);
    color: var(--sable); text-decoration: none; cursor: pointer;
}
.btn:hover { background: var(--argent); border-color: #d3cec4; }
.btn-primary { background: var(--azur); border-color: var(--azur); color: #fff; margin-top: 1.25rem; }
.btn-primary:hover { background: var(--azur-fonce); border-color: var(--azur-fonce); }
.btn-ghost { background: transparent; }
.btn-small { padding: .3rem .6rem; font-size: .8rem; margin: 0; }
.btn-danger { color: var(--gueules); border-color: #e8cdcb; }
.btn-danger:hover { background: var(--gueules-clair); border-color: #dcb5b2; }
.link-button { background: none; border: 0; padding: 0; color: var(--sable-doux); cursor: pointer; font-size: 1rem; font-family: inherit; }
.link-button:hover { color: var(--sable); text-decoration: underline; }
.inline { display: inline; }

/* --- Alertes --- */
.alert { padding: .7rem .9rem; border-radius: 8px; margin-bottom: 1rem; font-size: .9rem; border: 1px solid; word-break: break-word; }
.alert-success { background: var(--or-clair); border-color: #ecd99b; color: #7a5c07; }
.alert-error   { background: var(--gueules-clair); border-color: #e8cdcb; color: #8d1d16; }
.alert-info    { background: var(--azur-clair); border-color: #c8d5ef; color: var(--azur-fonce); }

/* --- Tableaux --- */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th, .table td { padding: .7rem .85rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--sable-doux); background: #faf9f6; }
.table tbody tr:last-child td { border-bottom: 0; }
.right { text-align: right; }
.actions { display: flex; gap: .35rem; justify-content: flex-end; flex-wrap: wrap; }

/* --- Divers --- */
.muted { color: var(--sable-doux); }
.small { font-size: .82rem; }
.badge { display: inline-block; padding: .12rem .5rem; border-radius: 999px; font-size: .72rem; font-weight: 600; }
.badge-ok    { background: var(--azur-clair); color: var(--azur-fonce); }
.badge-warn  { background: var(--or-clair); color: #7a5c07; }
.badge-off   { background: #ece9e4; color: var(--sable-doux); }
.badge-admin { background: var(--gueules-clair); color: var(--gueules); margin-left: .4rem; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin: 1.25rem 0; }
.stat { background: var(--surface); border: 1px solid var(--line); border-top: 3px solid var(--or); border-radius: var(--radius); padding: 1rem; text-align: center; }
.stat-value { display: block; font-size: 1.7rem; font-weight: 600; color: var(--azur-fonce); }
.stat-label { font-size: .8rem; color: var(--sable-doux); }

.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; align-items: center; gap: .75rem; padding: .55rem 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.member-list li:last-child { border-bottom: 0; }
.member-name { font-weight: 500; flex: 1; }
.avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 50%;
    background: var(--azur); color: #fff; font-size: .8rem; font-weight: 600;
}

.detail { display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1.25rem; margin: 0; font-size: .92rem; }
.detail dt { color: var(--sable-doux); }
.detail dd { margin: 0; }

@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
    .actions { justify-content: flex-start; }
    .brand span { display: none; }
}

/* --- Paramètres --- */
.fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 0 1rem 1rem; margin: 1.5rem 0 0; }
.fieldset legend { padding: 0 .45rem; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: var(--sable-doux); }
.inline-form { margin-top: 1rem; }
code { background: var(--argent); padding: .1rem .35rem; border-radius: 4px; font-size: .88em; }

/* ------------------------------------------------------------------
   Emploi du temps
   Les teintes des séances prolongent le blason : azur, or et gueules
   en tête, puis des émaux voisins (sinople, pourpre, tanné) assourdis
   de la même façon. Fond très clair, filet coloré, texte foncé :
   le contraste reste lisible même sur un bloc de 20 pixels de haut.
   ------------------------------------------------------------------ */
.calendar {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    --cal-gutter: 3.4rem;
    --cal-heure: 3.1rem;
}

.cal-bar {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
    padding: .7rem .9rem;
    border-bottom: 1px solid var(--line);
}
.cal-nav { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
/* Une seule majuscule initiale : « 31 août – 6 sept. », pas « 31 Août – 6 Sept. » */
.cal-title { margin: 0 0 0 .5rem; font-size: 1.05rem; font-weight: 600; }
.cal-title::first-letter { text-transform: uppercase; }
.cal-arrow {
    width: 2rem; height: 2rem; line-height: 1; font-size: 1.2rem;
    background: var(--surface); border: 1px solid var(--line); border-radius: 8px;
    color: var(--sable-doux); cursor: pointer;
}
.cal-arrow:hover { background: var(--azur-clair); color: var(--azur-fonce); border-color: #c8d5ef; }

/* Sélecteur de vue : un seul bloc segmenté, souligné d'or comme la barre du site */
.cal-views { display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cal-views button {
    padding: .35rem .75rem; font-size: .85rem; font-family: inherit;
    background: var(--surface); border: 0; border-left: 1px solid var(--line);
    color: var(--sable-doux); cursor: pointer;
}
.cal-views button:first-child { border-left: 0; }
.cal-views button:hover { background: var(--argent); }
.cal-views button.is-active { background: var(--azur-clair); color: var(--azur-fonce); font-weight: 600; box-shadow: inset 0 -3px 0 var(--or); }

.cal-body { position: relative; }
.calendar.is-loading .cal-body { opacity: .45; transition: opacity .15s; }
.cal-vide { padding: 2.5rem 1rem; text-align: center; color: var(--sable-doux); }
.cal-aide { padding: .5rem .9rem .7rem; margin: 0; border-top: 1px solid var(--line); }
.cal-aide kbd {
    font: inherit; font-size: .78rem; padding: 0 .3rem;
    border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; background: var(--argent);
}

/* --- Grille horaire (jour et semaine) --- */
.cal-grid { overflow-x: auto; }
.cal-grid:not(.cal-grid-jour) .cal-head,
.cal-grid:not(.cal-grid-jour) .cal-allday,
.cal-grid:not(.cal-grid-jour) .cal-inner { min-width: 46rem; }

.cal-head, .cal-allday, .cal-inner {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    grid-template-columns: var(--cal-gutter);
}
.cal-head { border-bottom: 1px solid var(--line); }
.cal-gutter-head { font-size: .7rem; color: var(--sable-doux); text-align: right; padding: .35rem .4rem; }

.cal-head-cell {
    display: flex; flex-direction: column; align-items: center; gap: .15rem;
    padding-bottom: .35rem; border-left: 1px solid var(--line);
}
.cal-head-day {
    display: flex; flex-direction: column; align-items: center; gap: .05rem; width: 100%;
    padding: .4rem .2rem .15rem; background: none; border: 0;
    font-family: inherit; color: var(--sable-doux); cursor: pointer;
}
.cal-head-day:hover { background: var(--argent); }
.cal-head-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; }
.cal-head-num  { font-size: 1.05rem; font-weight: 600; color: var(--sable); }
.cal-head-day.is-today .cal-head-num {
    background: var(--azur); color: #fff; border-radius: 999px;
    width: 1.7rem; height: 1.7rem; display: grid; place-items: center;
}

.cal-allday { border-bottom: 1px solid var(--line); background: var(--argent); }
.cal-allday-cell { border-left: 1px solid var(--line); padding: .2rem; display: flex; flex-direction: column; gap: .15rem; }

.cal-scroll { overflow-y: auto; max-height: 64vh; }
.cal-inner { height: calc(var(--cal-heures, 11) * var(--cal-heure)); }

.cal-gutter { display: flex; flex-direction: column; }
.cal-hour {
    height: var(--cal-heure); font-size: .72rem; color: var(--sable-doux);
    text-align: right; padding-right: .4rem; transform: translateY(-.45em);
}

.cal-col { position: relative; border-left: 1px solid var(--line); display: flex; flex-direction: column; }
.cal-col.is-today { background: #fbfaf7; }
.cal-slot {
    height: var(--cal-heure); background: none; border: 0; border-top: 1px solid var(--line);
    padding: 0; cursor: pointer;
}
.cal-slot:first-child { border-top: 0; }
.cal-slot:hover { background: var(--azur-clair); }

.cal-event {
    position: absolute; overflow: hidden; text-align: left;
    padding: .18rem .3rem; font-family: inherit; font-size: .74rem; line-height: 1.25;
    background: var(--evt-fond); color: var(--evt-encre);
    border: 1px solid var(--evt-bord); border-left: 3px solid var(--evt-teinte);
    border-radius: 5px; cursor: pointer;
    display: flex; flex-direction: column; gap: .05rem;
}
.cal-event:hover { filter: brightness(.97); box-shadow: 0 1px 4px rgba(28, 27, 31, .16); z-index: 2; }
.cal-event-time  { font-size: .68rem; opacity: .8; }
.cal-event-title { font-weight: 600; }
.cal-event-meta  { font-size: .68rem; opacity: .75; }
.cal-event.is-manual { border-style: dashed; }
.cal-event.is-vanished, .cal-chip.is-vanished { opacity: .5; text-decoration: line-through; }

/* Pastille d'or : ce jour porte un bilan. Discrète, elle ne doit pas se
   confondre avec une séance. */
.cal-bilan {
    display: inline-grid; place-items: center; text-decoration: none;
    padding: .05rem .35rem; margin-left: .3rem;
    background: var(--or); color: #43330a; border-radius: 999px;
    font-size: .6rem; font-weight: 700; line-height: 1.5;
    text-transform: uppercase; letter-spacing: .04em; vertical-align: middle;
}
.cal-bilan:hover { background: #a5820f; color: #fff; }
.cal-day > .cal-bilan { position: absolute; top: .35rem; right: .35rem; margin: 0; }
.cal-head-cell > .cal-bilan { margin: 0; }
.cal-day { position: relative; }

/* Séance dont on possède l'enregistrement : liseré d'or sur le bord opposé
   à la teinte du module, pour ne pas se confondre avec elle. */
.cal-event.has-bilan { border-right: 3px solid var(--or); }
.cal-chip.has-bilan  { box-shadow: inset -3px 0 0 var(--or); }

.detail-bilan { display: block; text-align: center; margin: 0 0 .4rem; }
.modal-body .detail-bilan + .hint { margin-bottom: .2rem; }

/* --- Manipulation directe --- */
.cal-event.is-draggable, .cal-chip.is-draggable { cursor: grab; touch-action: none; }
.cal-event.is-moving {
    cursor: grabbing; z-index: 6; opacity: .92;
    box-shadow: 0 4px 14px rgba(28, 27, 31, .25);
}
.calendar.is-dragging { user-select: none; }
.calendar.is-dragging .cal-slot:hover { background: none; }

/* Poignée d'allongement : discrète au repos, franche au survol */
.cal-resize {
    position: absolute; left: 0; right: 0; bottom: 0; height: 7px;
    cursor: ns-resize; border-radius: 0 0 4px 4px;
}
.cal-event.is-draggable:hover .cal-resize { background: var(--evt-teinte); opacity: .35; }

/* Créneau en cours de tracé */
.cal-apercu {
    left: 0; width: 100%; pointer-events: none;
    background: var(--azur-clair); color: var(--azur-fonce);
    border: 1px dashed var(--azur); border-left-width: 3px;
}

.cal-day.is-drop { background: var(--azur-clair); box-shadow: inset 0 0 0 2px var(--azur); }

/* Heure courante : le seul trait rouge de l'interface, il doit se voir */
.cal-now { position: absolute; left: 0; right: 0; border-top: 2px solid var(--gueules); z-index: 3; pointer-events: none; }
.cal-now::before {
    content: ''; position: absolute; left: -4px; top: -5px;
    width: 8px; height: 8px; border-radius: 50%; background: var(--gueules);
}

/* --- Vue mois --- */
.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-month-head {
    padding: .35rem .4rem; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em;
    color: var(--sable-doux); border-bottom: 1px solid var(--line); text-align: center;
}
.cal-day {
    min-height: 6.4rem; padding: .25rem; display: flex; flex-direction: column; gap: .15rem;
    border-left: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.cal-day:nth-child(7n + 1) { border-left: 0; }
.cal-day.is-outside { background: var(--argent); }
.cal-day.is-outside .cal-day-num { color: #b3afa6; }
.cal-day-num {
    align-self: flex-start; min-width: 1.55rem; height: 1.55rem; padding: 0 .3rem;
    background: none; border: 0; border-radius: 999px; cursor: pointer;
    font-family: inherit; font-size: .82rem; color: var(--sable-doux);
}
.cal-day-num:hover { background: var(--azur-clair); color: var(--azur-fonce); }
.cal-day.is-today .cal-day-num { background: var(--azur); color: #fff; font-weight: 600; }

.cal-chip {
    display: flex; align-items: baseline; gap: .3rem; width: 100%; text-align: left;
    padding: .1rem .3rem; border: 0; border-left: 3px solid var(--evt-teinte); border-radius: 4px;
    background: var(--evt-fond); color: var(--evt-encre);
    font-family: inherit; font-size: .72rem; line-height: 1.3; cursor: pointer;
}
.cal-chip:hover { filter: brightness(.96); }
.cal-chip-time  { opacity: .75; font-variant-numeric: tabular-nums; }
.cal-chip-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-more {
    align-self: flex-start; background: none; border: 0; padding: 0 .3rem; cursor: pointer;
    font-family: inherit; font-size: .7rem; color: var(--sable-doux); text-decoration: underline;
}

/* --- Vue année --- */
.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; padding: 1rem; }
.cal-year-title {
    display: block; width: 100%; text-align: left; background: none; border: 0; cursor: pointer;
    font-family: inherit; font-size: .85rem; font-weight: 600; text-transform: capitalize;
    color: var(--azur-fonce); padding: 0 0 .3rem;
}
.cal-mini { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-mini-head { font-size: .62rem; color: var(--sable-doux); text-align: center; }
.cal-mini-day {
    aspect-ratio: 1; display: grid; place-items: center; border: 0; border-radius: 4px;
    background: none; font-family: inherit; font-size: .68rem; color: var(--sable-doux); cursor: pointer;
}
.cal-mini-day.is-outside { visibility: hidden; }
.cal-mini-day:hover { outline: 1px solid var(--azur); }
/* Densité : plus le jour est chargé, plus l'azur est soutenu */
.cal-mini-day[data-charge="1"] { background: #e7edf9; color: var(--azur-fonce); }
.cal-mini-day[data-charge="2"] { background: #c9d8f1; color: var(--azur-fonce); }
.cal-mini-day[data-charge="3"] { background: var(--azur); color: #fff; }
.cal-mini-day.is-today { box-shadow: inset 0 0 0 2px var(--or); font-weight: 700; }

/* --- Palette des séances --- */
.evt-c0 { --evt-teinte: #234ea8; --evt-fond: #edf1fa; --evt-bord: #cfdaf1; --evt-encre: #1a3a7d; }
.evt-c1 { --evt-teinte: #c9a227; --evt-fond: #fbf3d9; --evt-bord: #ecd99b; --evt-encre: #6f5209; }
.evt-c2 { --evt-teinte: #b3241c; --evt-fond: #fbeceb; --evt-bord: #e8cdcb; --evt-encre: #8d1d16; }
.evt-c3 { --evt-teinte: #2f6b4f; --evt-fond: #e9f3ee; --evt-bord: #c4dcd0; --evt-encre: #22513c; }
.evt-c4 { --evt-teinte: #7a3b6b; --evt-fond: #f5ecf3; --evt-bord: #ddc7d7; --evt-encre: #5d2c51; }
.evt-c5 { --evt-teinte: #1f6f7a; --evt-fond: #e7f2f4; --evt-bord: #c0dade; --evt-encre: #17545c; }
.evt-c6 { --evt-teinte: #8a5a2b; --evt-fond: #f6efe6; --evt-bord: #dfcdb5; --evt-encre: #6a4520; }
.evt-c7 { --evt-teinte: #4a5468; --evt-fond: #eef0f4; --evt-bord: #d2d7e0; --evt-encre: #394151; }

/* --- Boîtes de dialogue --- */
.modal {
    width: min(34rem, calc(100vw - 2rem)); padding: 0;
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); color: var(--sable); box-shadow: 0 12px 40px rgba(28, 27, 31, .22);
}
.modal-large { width: min(44rem, calc(100vw - 2rem)); }
.modal::backdrop { background: rgba(28, 27, 31, .45); }
.modal-head {
    display: flex; align-items: center; justify-content: space-between; gap: 1rem;
    padding: .8rem 1rem; border-bottom: 1px solid var(--line); box-shadow: inset 0 -3px 0 var(--or);
}
.modal-head h2 { margin: 0; font-size: 1.05rem; }
.modal-close { background: none; border: 0; font-size: 1.4rem; line-height: 1; color: var(--sable-doux); cursor: pointer; }
.modal-body { padding: 1rem; max-height: 60vh; overflow-y: auto; }
.modal-body .form > label:first-of-type { margin-top: 0; }
.modal-body .detail { margin: 0; }
/* Les salles arrivent sur plusieurs lignes dans le flux : on les garde ainsi */
.modal-body .detail dd { margin: 0; white-space: pre-line; }
.modal-body .alert { margin: 1rem 0 0; }
.modal-foot { display: flex; justify-content: flex-end; gap: .5rem; padding: .8rem 1rem; border-top: 1px solid var(--line); }
/* « display: flex » l'emporterait sur l'attribut hidden : il faut le dire explicitement */
.modal-foot[hidden] { display: none; }
.modal-foot .btn { margin-top: 0; }

/* ------------------------------------------------------------------
   Bilans journaliers
   ------------------------------------------------------------------ */
.form input[type=file] { width: 100%; padding: .55rem 0; font-size: .92rem; font-family: inherit; }

.report-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .6rem; }
.report-list li {
    display: flex; gap: .9rem; align-items: flex-start;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    padding: .8rem .9rem;
}

/* Le quantième en gros : on cherche un jour avant de chercher un titre */
.report-date {
    flex: 0 0 3.6rem; text-align: center; text-decoration: none; color: var(--sable);
    border-right: 1px solid var(--line); padding-right: .8rem; line-height: 1.15;
}
.report-day   { display: block; font-size: 1.6rem; font-weight: 600; color: var(--azur-fonce); }
.report-month { display: block; font-size: .72rem; color: var(--sable-doux); }
.report-year  { display: block; font-size: .68rem; color: #a19d94; }

.report-main { min-width: 0; }
.report-title { font-weight: 600; text-decoration: none; color: var(--sable); }
.report-title:hover { color: var(--azur-fonce); text-decoration: underline; }
.report-extrait { margin: .2rem 0 .35rem; }

.report-synthese { border-left: 3px solid var(--or); background: #fffdf6; }
.report-groupe { font-size: .9rem; margin: 1rem 0 .4rem; color: var(--azur-fonce); }

/* Cases à cocher décoratives : le résumé les livre déjà cochées ou non */
.report-actions { list-style: none; margin: 0; padding: 0; }
.report-actions li { position: relative; padding: .3rem 0 .3rem 1.6rem; border-bottom: 1px solid var(--line); }
.report-actions li:last-child { border-bottom: 0; }
.report-actions li::before {
    content: ''; position: absolute; left: 0; top: .55rem;
    width: .85rem; height: .85rem; border: 1.5px solid var(--line); border-radius: 3px; background: #fff;
}
.report-actions p { margin: 0; font-size: .92rem; }

.report-fichiers { list-style: none; margin: 0; padding: 0; }
.report-fichiers li { display: flex; gap: .6rem; align-items: baseline; padding: .3rem 0; flex-wrap: wrap; }

.report-brut summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
.report-brut pre {
    margin: .8rem 0 0; padding: .8rem; background: var(--argent); border-radius: 8px;
    font-size: .8rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
}

.panel code, .report-actions code {
    background: var(--argent); border: 1px solid var(--line); border-radius: 4px;
    padding: 0 .25rem; font-size: .88em;
}

.pagination { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: 1.25rem; }
.pagination a {
    padding: .25rem .6rem; border: 1px solid var(--line); border-radius: 6px;
    text-decoration: none; color: var(--sable-doux); background: var(--surface); font-size: .85rem;
}
.pagination a:hover { background: var(--azur-clair); }
.pagination a.is-active { background: var(--azur); border-color: var(--azur); color: #fff; font-weight: 600; }

/* --- Transcription --- */
.report-reglages { margin: 0 0 1.25rem; }
.report-reglages summary { cursor: pointer; font-size: .88rem; color: var(--azur-fonce); }
.report-reglages .form { padding-top: .5rem; }
.report-reglages .form label.small { font-size: .78rem; font-weight: 400; color: var(--sable-doux); }

.report-tranche { margin: 0 0 1.25rem; }
.report-cours {
    font-size: .92rem; margin: 0 0 .6rem; padding-bottom: .35rem;
    border-bottom: 2px solid var(--or); display: flex; gap: .6rem; align-items: baseline; flex-wrap: wrap;
}

/* Hors des cours : replié par défaut, mais rien n'est perdu — un cours déborde,
   et l'essentiel se dit parfois juste après. */
.report-hors {
    background: var(--argent); border: 1px dashed var(--line); border-radius: var(--radius);
    padding: .5rem .75rem;
}
.report-hors summary { cursor: pointer; font-size: .85rem; color: var(--sable-doux); }
.report-hors[open] summary { margin-bottom: .6rem; }

.report-prise { display: grid; grid-template-columns: 3.4rem 1fr; gap: .2rem .7rem; padding: .35rem 0; }
.report-prise + .report-prise { border-top: 1px solid var(--line); }
.report-heure { font-size: .72rem; color: var(--sable-doux); font-variant-numeric: tabular-nums; padding-top: .15rem; }
.report-locuteur { grid-column: 2; font-size: .74rem; font-weight: 600; }
.report-prise p { grid-column: 2; margin: 0; font-size: .92rem; line-height: 1.5; }

/* Une teinte par locuteur, pour suivre l'échange d'un coup d'œil */
.loc-0 { color: var(--azur-fonce); }
.loc-1 { color: #7a5c07; }
.loc-2 { color: #2f6b4f; }
.loc-3 { color: #7a3b6b; }
.loc-4 { color: #1f6f7a; }
.loc-5 { color: #8a5a2b; }

@media (max-width: 700px) {
    .report-prise { grid-template-columns: 1fr; }
    .report-locuteur, .report-prise p { grid-column: 1; }
}

/* --- Retours d'enregistrement --- */
.toasts {
    position: fixed; left: 50%; bottom: 1.25rem; transform: translateX(-50%);
    display: flex; flex-direction: column; gap: .5rem; z-index: 50;
    width: min(26rem, calc(100vw - 2rem)); pointer-events: none;
}
.toast {
    background: var(--sable); color: #fff; font-size: .88rem;
    padding: .6rem .85rem; border-radius: 8px; border-left: 3px solid var(--or);
    box-shadow: 0 6px 22px rgba(28, 27, 31, .28);
    animation: toast-entre .18s ease-out;
}
.toast-erreur { background: var(--gueules); border-left-color: #7a1610; }
.toast.is-out { opacity: 0; transition: opacity .3s; }
@keyframes toast-entre { from { opacity: 0; transform: translateY(.5rem); } }

@media (prefers-reduced-motion: reduce) {
    .toast { animation: none; }
}

@media (max-width: 700px) {
    .cal-title { margin-left: 0; width: 100%; }
    .cal-day { min-height: 4.6rem; }
    .cal-chip-time { display: none; }
}
