/* =====================================================================
   Fonctionnalités du quotidien et de gestion : carnet de liaison, photos,
   carnet repas, documents, relevés Pajemploi, revenus, avis, notifications.
   S'appuie sur les jetons de palettes.css / ui.css.
   ===================================================================== */

/* --- Barre de sélection (enfant / contrat + date) --- */
.journal-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; }
.journal-children { display: flex; flex-wrap: wrap; gap: 8px; }
.journal-child {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px;
    background: var(--ui-surface); border: 1px solid var(--ui-border); color: var(--ui-text); text-decoration: none;
    font-weight: 600; font-size: .9rem; transition: all var(--ui-fast) var(--ui-ease);
}
.journal-child:hover { border-color: var(--accent-light); color: var(--accent-strong); }
.journal-child.is-active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 3px var(--accent-softer, transparent); }
.journal-date { display: flex; align-items: center; gap: 8px; }
.journal-date input[type="date"] { width: auto; }
.journal-cover-go { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; font-weight: 800; white-space: nowrap; }
/* « Fond » : lien discret vers la fiche « Fond des pages » du carnet (même choix que Mon compte → Carnet de liaison) */
.journal-paper-go { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 6px; font-weight: 700; color: var(--muted); text-decoration: none; white-space: nowrap; }
.journal-paper-go:hover, .journal-paper-go:focus-visible { color: var(--brand-600); text-decoration: underline; }

/* --- Pointage --- */
.check-board { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.check-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: var(--ui-radius); background: var(--ui-surface-2); }
/* Enfants sans accueil prévu ce jour : pointage replié (accueil imprévu) */
.check-more > summary { cursor: pointer; color: var(--ui-muted, #6c757d); }
.check-time { width: 130px; }

/* --- Frise de la journée --- */
.timeline { list-style: none; margin: 0; padding: 0 0 0 6px; position: relative; }
.timeline::before { content: ''; position: absolute; left: 23px; top: 6px; bottom: 6px; width: 2px; background: var(--ui-border); }
.timeline-item { position: relative; display: flex; gap: 14px; padding: 6px 0; animation: ui-fade-up .35s var(--ui-ease) both; }
.timeline-icon {
    position: relative; z-index: 1; flex: 0 0 36px; height: 36px; border-radius: 12px; display: grid; place-items: center;
    background: var(--tl-bg, var(--ui-surface-2)); color: var(--tl-fg, var(--ui-text)); box-shadow: 0 0 0 4px var(--ui-surface);
}
.timeline-body { flex: 1; min-width: 0; padding: 8px 12px; border-radius: var(--ui-radius); background: var(--ui-surface-2); }
.timeline-time { font-variant-numeric: tabular-nums; color: var(--ui-muted); font-size: .85rem; white-space: nowrap; }
.tl-ok { --tl-bg: var(--c-ok-soft); --tl-fg: var(--c-ok); }
.tl-warm { --tl-bg: var(--c-warm-soft); --tl-fg: var(--c-warm-deep); }
.tl-brand { --tl-bg: var(--c-brand-soft); --tl-fg: var(--c-brand-strong); }
.tl-danger { --tl-bg: var(--ui-danger-soft); --tl-fg: var(--ui-danger); }
.tl-ink { --tl-bg: var(--ink-50); --tl-fg: var(--c-ink); }

/* --- Saisie rapide --- */
.entry-types { display: flex; flex-wrap: wrap; gap: 6px; }
.entry-type { position: relative; cursor: pointer; }
.entry-type input { position: absolute; opacity: 0; pointer-events: none; }
.entry-type span {
    display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-size: .85rem; font-weight: 600;
    border: 1px solid var(--ui-border); background: var(--ui-surface); transition: all var(--ui-fast) var(--ui-ease);
}
.entry-type input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast, #fff); }
.entry-type input:focus-visible + span { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 30%, transparent); }

/* --- Photos --- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.photo-item { position: relative; margin: 0; border-radius: var(--ui-radius); overflow: hidden; background: var(--ui-surface-2); }
.photo-item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; transition: transform var(--ui-med) var(--ui-ease); }
.photo-item:hover img { transform: scale(1.04); }
.photo-item figcaption { padding: 6px 8px; font-size: .78rem; color: var(--ui-muted); }
.photo-item form { position: absolute; top: 6px; right: 6px; }
.photo-delete { border: 0; width: 28px; height: 28px; border-radius: 50%; background: rgba(0, 0, 0, .55); color: #fff; }
.gallery-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gallery-grid .photo-item { background: var(--ui-surface); border: 1px solid var(--ui-border); }
.gallery-expiry { color: var(--ui-muted); }

/* --- Listes latérales --- */
.supply-item, .med-item, .incident-item { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--ui-border); }
.med-item, .incident-item { display: block; }
.supply-item:last-child, .med-item:last-of-type, .incident-item:last-of-type { border-bottom: 0; }
.supply-item.is-done strong { text-decoration: line-through; color: var(--ui-muted); }

/* --- Carnet repas (pages/assistant/menus.php, pages/parent/meals.php, carnet de liaison) --- */
/* Charte du site (PARCOURS-SIMPLE.md) : fond uni, cartes blanches sans bordure, la couleur dit l'état
   (brand = action et navigation, ok = fait, warm = à faire, bad = bloquant), couleurs de la palette seulement */
.meal-book { max-width: 880px; margin: 0 auto; }

/* En-tête (uiPageHead) : semaine sous la phrase, dessin à droite sur ordinateur */
.meal-head .ui-page-head-text { justify-items: start; }
.meal-head-art { width: 170px; }
.meal-head-art .ill { display: block; width: 100%; height: auto; }
.meal-head-today { font-size: .875rem; font-weight: 700; }
.meal-weeknav {
    display: flex; align-items: center; justify-content: space-between; gap: 8px; width: min(100%, 380px); margin-top: 10px; padding: 6px 8px;
    border-radius: 999px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm);
}
.meal-weeknav-arrow {
    flex: 0 0 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; color: var(--ink-700); text-decoration: none;
    transition: background var(--ui-fast), color var(--ui-fast);
}
.meal-weeknav-arrow:hover { background: var(--accent-soft); color: var(--accent-ink); }
.meal-weeknav-label { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; color: var(--ink-800); white-space: nowrap; }
.meal-weeknav-label i { color: var(--accent-strong); font-size: 1.05rem; }

/* Jours de la semaine : le jour ouvert en couleur d'action, la coche dit l'état (fait / à faire) */
.meal-daytabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 4px 0 26px; }
.meal-daytab {
    display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 16px; text-decoration: none;
    background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); color: var(--ink-800); transition: box-shadow var(--ui-fast);
}
.meal-daytab:hover { box-shadow: var(--ui-shadow); color: var(--ink-800); }
.meal-daytab-name { position: relative; font-weight: 800; font-size: 1rem; }
.meal-daytab-today { position: absolute; top: 2px; right: -9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.meal-daytab-date { display: inline-flex; align-items: center; gap: 6px; font-size: .95rem; color: var(--ink-600); white-space: nowrap; }
.meal-daytab-state { font-size: 1rem; }
.meal-daytab.is-done .meal-daytab-state { color: var(--ok-500); }
.meal-daytab.is-draft .meal-daytab-state, .meal-daytab.is-partial .meal-daytab-state { color: var(--warm-500); }
.meal-daytab.is-active { background: var(--accent); }
.meal-daytab.is-active, .meal-daytab.is-active .meal-daytab-date, .meal-daytab.is-active .meal-daytab-state { color: var(--accent-contrast); }
.meal-daytab.is-active .meal-daytab-today { background: var(--accent-contrast); }

/* Bloc du jour : les repas regroupés sur un fond doux de la teinte de la palette, cerné d'un liseré un ton plus foncé ;
   les cartes repas y sont des cartes dans une carte (filet de la même teinte) */
.meal-day { padding: 22px 24px 24px; border-radius: 32px; background: var(--brand-50); border: 1px solid var(--brand-200); }
.meal-day .meal-card, .meal-day .meal-week-day, .meal-day .meal-note, .meal-day .meal-empty { border: 1px solid var(--brand-100); box-shadow: var(--ui-shadow-xs); }
.meal-day-head { margin-bottom: 16px; }
.meal-day-head .meal-day-title { margin: 0; }
.meal-day-head .meal-watch { margin: 6px 0 0; }
.meal-day-foot { margin-top: 20px; padding-top: 4px; }
.meal-day-foot .meal-actions { margin: 18px 0 0; padding-top: 18px; border-top: 1px solid var(--brand-100); }
.meal-day .meal-daynav { margin-bottom: 18px; }
.meal-day-title { margin: 0 0 14px; font-size: 1.5rem; font-weight: 900; color: var(--ink-800); }
.meal-watch { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: -6px 0 14px; font-size: .875rem; color: var(--warm-700); }
.meal-watch > i { color: var(--warm-500); }

/* Carte d'un repas : blanche, sans bordure, ombre douce */
.meal-cards { display: grid; gap: 16px; }
.meal-card { padding: 14px 18px 18px; border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.meal-card-head h3 { flex: 1; margin: 0; font-size: 1.05rem; font-weight: 800; color: var(--ink-800); }
.meal-icon { flex: 0 0 30px; display: inline-grid; place-items: center; }
.meal-icon .ill { width: 30px; height: 30px; }
.meal-more { width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--ink-600); }
.meal-more:hover, .meal-more[aria-expanded="true"] { background: var(--ui-surface-2); }
.meal-card-body { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 18px; align-items: center; }
.meal-card.is-edit .meal-card-body { align-items: start; }
.meal-photo-frame { position: relative; }
.meal-photo { display: block; width: 100%; aspect-ratio: 9 / 5; object-fit: cover; border-radius: 16px; background: var(--ui-surface-2); }
.meal-photo.is-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--ink-600); font-size: .85rem; font-weight: 700;
    border: 1.5px dashed var(--ui-border-strong); background: var(--ui-surface-2);
}
.meal-photo.is-empty i { font-size: 1.25rem; color: var(--accent-strong); }
.meal-photo.is-empty .ill { width: 52px; height: 52px; }
.meal-photo-pick { display: block; margin: 0; cursor: pointer; border-radius: 16px; }
.meal-photo-pick:hover .meal-photo { filter: brightness(.96); }
.meal-photo-frame:focus-within .meal-photo-pick { outline: 3px solid var(--accent); outline-offset: 2px; }
.meal-photo.is-new { outline: 3px solid var(--accent); outline-offset: -3px; }
.meal-card-text { min-width: 0; }
.meal-dish {
    display: block; width: 100%; min-height: 46px; padding: 11px 16px; border: 1px solid var(--ui-border); border-radius: 16px; resize: none; overflow: hidden;
    background: var(--ui-surface); color: var(--ink-800); font: inherit; font-size: 1rem; line-height: 1.4;
}
.meal-dish:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.meal-allergens { margin-top: 12px; }
.meal-allergens > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; list-style: none; cursor: pointer; }
.meal-allergens > summary::-webkit-details-marker { display: none; }
.meal-allergens-label { font-size: .92rem; color: var(--ink-700); }
.meal-allergens .meal-chips { flex: 1 1 auto; }
.meal-edit-btn {
    margin-left: auto; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; color: var(--accent-strong);
    background: var(--ui-surface); border: 1px solid var(--ui-border); transition: background var(--ui-fast), border-color var(--ui-fast);
}
.meal-allergens > summary:hover .meal-edit-btn, .meal-allergens[open] .meal-edit-btn { background: var(--accent-soft); border-color: var(--accent); }
.meal-allergens > summary:focus-visible { outline: none; }
.meal-allergens > summary:focus-visible .meal-edit-btn { outline: 3px solid var(--accent); outline-offset: 2px; }
.meal-allergens-panel { margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--ui-surface-2); }

/* Pastilles : allergène = information (neutre), aucun allergène = fait (ok), brouillon = à faire (warm), allergie de l'enfant = bloquant (bad) */
.meal-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.meal-chip {
    display: inline-flex; align-items: center; gap: 7px; padding: 5px 13px; border-radius: 999px; font-size: .9rem; font-weight: 600; line-height: 1.3;
    background: var(--ui-surface-2); color: var(--ink-800); white-space: nowrap;
}
.meal-chip i { color: var(--accent-strong); }
.meal-chip[hidden] { display: none; }
.meal-chip.is-none { background: var(--ok-50); color: var(--ok-700); }
.meal-chip.is-none i { color: var(--ok-500); }
.meal-chip.is-draft { padding: 2px 10px; font-size: .78rem; font-weight: 700; background: var(--warm-50); color: var(--warm-700); }
.meal-chip.is-alert { background: var(--bad-50); color: var(--bad-600); white-space: normal; }
.meal-chip.is-alert i { color: var(--bad-600); }
.meal-chips.is-small .meal-chip { padding: 2px 9px; font-size: .78rem; }
.meal-alert {
    display: flex; align-items: flex-start; gap: 8px; margin: 10px 0 0; padding: 7px 11px; border-radius: 12px; font-size: .875rem; font-weight: 700;
    background: var(--bad-50); color: var(--bad-600);
}
.meal-alert i { margin-top: 3px; }
.meal-photo-help { margin: 12px 4px 0; font-size: .85rem; color: var(--ui-muted); }

/* Actions de la journée : boutons du site, une seule action pleine */
.meal-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 26px 0 6px; }
.meal-actions .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding-inline: 22px; }
.meal-duplicate { margin: 16px 0 0; padding: 14px 18px; border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-duplicate legend { float: none; width: auto; margin-bottom: 8px; font-size: .95rem; font-weight: 800; color: var(--ink-800); }
.meal-settings { margin: 26px 0 0; text-align: center; }
.meal-settings summary { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: .9rem; font-weight: 700; color: var(--ink-600); }
.meal-settings-form { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 12px; padding: 14px 18px; border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); text-align: left; }

/* Améliorer la photo : avant / après */
.meal-enhance-dialog { max-width: 390px; }
.meal-enhance { padding: 18px 18px 12px; border: 0; border-radius: 24px; box-shadow: var(--ui-shadow-lg); }
.meal-enhance-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.meal-enhance-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.15rem; font-weight: 800; color: var(--ink-800); }
.meal-enhance-head h2 i { color: var(--accent-strong); font-size: 1.15rem; }
.meal-enhance-head .btn-close { font-size: .8rem; }
.meal-enhance-compare { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 16px 0 14px; }
.meal-enhance-compare figure { margin: 0; }
.meal-enhance-compare figcaption {
    display: table; margin: 0 auto 7px; padding: 3px 14px; border-radius: 999px; font-size: .82rem; font-weight: 700; background: var(--ui-surface-2); color: var(--ink-700);
}
.meal-enhance-compare figcaption.is-after { background: var(--accent); color: var(--accent-contrast); }
.meal-enhance-compare figcaption.is-after i { font-size: .75rem; }
.meal-enhance-compare canvas { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 12px; background: var(--ui-surface-2); }
.meal-enhance-arrow {
    position: absolute; left: 50%; top: calc(50% + 15px); width: 30px; height: 30px; display: grid; place-items: center; transform: translate(-50%, -50%);
    border-radius: 50%; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); color: var(--ink-600); font-size: .8rem;
}
.meal-enhance-list { list-style: none; margin: 0 0 16px; padding: 0 0 0 52px; display: grid; gap: 6px; font-size: .92rem; color: var(--ink-700); }
.meal-enhance-list i { margin-right: 8px; color: var(--ok-500); }
.meal-enhance-keep { display: block; margin: 8px auto 0; padding: 4px 8px; border: 0; background: none; font-size: .85rem; color: var(--ui-muted); }
.meal-enhance-keep:hover { color: var(--ink-700); text-decoration: underline; }

/* Vue des parents : colonne centrée sur tablette, largeur de la page sur ordinateur (voir la fin de la section) */
.meal-parent { max-width: 660px; margin: 0 auto; }
.meal-parent-head { display: flex; align-items: center; gap: 20px; margin-bottom: 20px; }
.meal-parent-head h1, .meal-parent-head h2 { margin: 0; font-size: var(--fs-page, 2rem); font-weight: 900; line-height: 1.15; color: var(--ink-800); }
.meal-parent-head p { margin: 4px 0 0; color: var(--ink-600); font-size: 1.02rem; }
.meal-parent-head .ui-avatar { box-shadow: 0 0 0 4px var(--ui-surface), var(--ui-shadow-sm); }
.meal-parent-avatar.is-drawing { flex: 0 0 76px; height: 76px; display: grid; place-items: center; border-radius: 50%; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-children { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.meal-child { display: inline-flex; align-items: center; gap: 8px; padding: 4px 14px 4px 4px; border-radius: 999px; background: var(--ui-surface); box-shadow: var(--ui-shadow-xs); color: var(--ink-800); text-decoration: none; font-weight: 700; }
.meal-child.is-active { background: var(--accent-soft); color: var(--accent-ink); box-shadow: inset 0 0 0 1.5px var(--accent); }
.meal-switch { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 18px; padding: 4px; border-radius: 999px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-switch a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 10px; border-radius: 999px; color: var(--ink-700); text-decoration: none; font-weight: 700; font-size: 1rem; }
.meal-switch a i { color: var(--ink-500); font-size: 1.05rem; }
.meal-switch a:hover { color: var(--accent-ink); }
.meal-switch a.is-active { background: var(--accent); color: var(--accent-contrast); }
.meal-switch a.is-active i { color: var(--accent-contrast); }
.meal-daynav { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 0 0 18px; }
.meal-daynav .meal-weeknav-arrow { flex-basis: 44px; height: 44px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-daynav-label { display: inline-flex; align-items: center; gap: 12px; margin: 0; font-size: 1.25rem; font-weight: 800; color: var(--ink-800); }
.meal-daynav-cal { color: var(--accent-strong); font-size: 1.15rem; }
.meal-parent .meal-card { padding: 14px 20px 18px; }
.meal-parent .meal-card-body { grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); gap: 24px; }
.meal-parent .meal-photo { aspect-ratio: 2 / 1; }
.meal-card-dish { margin: 0 0 12px; font-size: 1.05rem; color: var(--ink-800); }
.meal-note { display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 16px 18px; border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-note-face { flex: 0 0 auto; }
.meal-note h3 { margin: 0 0 3px; font-size: 1rem; font-weight: 800; color: var(--ink-800); }
.meal-note p { margin: 0; font-style: italic; color: var(--ink-700); }
.meal-note p + p { margin-top: 4px; }
.meal-note-time { font-style: normal; font-size: .8rem; color: var(--ui-muted); }
.meal-note-qty { display: block; margin-top: 2px; font-style: normal; font-size: .8rem; color: var(--ui-muted); }
.meal-note.is-hint { font-size: .9rem; }
.meal-note.is-hint p { font-style: normal; }
.meal-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 28px 16px; text-align: center; color: var(--ink-600); border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); }
.meal-empty .ill-art { width: min(200px, 70%); height: auto; }
.meal-empty p { margin: 0; }
.meal-week { display: grid; gap: 12px; }
.meal-week-day { display: block; padding: 14px 18px; border-radius: 24px; background: var(--ui-surface); box-shadow: var(--ui-shadow-sm); color: var(--ink-800); text-decoration: none; }
.meal-week-day:hover { box-shadow: var(--ui-shadow); color: var(--ink-800); }
.meal-week-day.is-today { box-shadow: inset 0 0 0 2px var(--accent), var(--ui-shadow-sm); }
.meal-week-day h3 { margin: 0 0 8px; font-size: 1rem; font-weight: 800; }
.meal-week-day ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: .95rem; }
.meal-week-day li { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: start; gap: 6px 10px; }
.meal-week-day li .meal-icon .ill { width: 24px; height: 24px; }
/* Icône à gauche, plat à côté (jamais l'icône seule sur sa ligne) ; l'alerte d'allergie sous le plat */
.meal-week-day li > .meal-chip { grid-column: 2; justify-self: start; }
.meal-week-empty { margin: 0; color: var(--ui-muted); font-size: .92rem; }

/* Aperçu de la vue des parents (assistante) : la page des parents dans un cadre (filet : une carte dans une carte) */
.meal-preview-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; margin-bottom: 18px; }
.meal-preview-note { flex: 1 1 100%; margin: 0; text-align: center; font-weight: 800; color: var(--accent-ink); }
.meal-preview-bar form { margin: 0; }
.meal-parent.is-preview { padding: 22px 18px; }

/* Carnet de liaison : repas du jour avec la photo du plat */
.jbook-meals { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 8px; }
.jbook-meal { display: flex; align-items: flex-start; gap: 10px; }
.jbook-meal-photo { flex: 0 0 64px; width: 64px; height: 48px; border-radius: 10px; object-fit: cover; }
.jbook-meal-photo.is-empty { display: grid; place-items: center; background: var(--ui-surface-2); color: var(--accent-strong); }
.jbook-meal-text { flex: 1; min-width: 0; }
.jbook-meal-text .meal-chips { margin-top: 4px; gap: 5px; }
.jbook-menu-more { display: inline-flex; align-items: center; gap: 6px; margin-top: 8px; font-size: .875rem; font-weight: 700; }

@media (max-width: 768px) {
    .meal-day { padding: 14px 12px 16px; border-radius: 24px; }
    .meal-head-art { display: none; }
    .meal-weeknav { width: 100%; }
    .meal-daytabs { gap: 6px; margin-bottom: 20px; }
    .meal-daytab { padding: 8px 2px; border-radius: 14px; }
    .meal-daytab-name { font-size: .92rem; }
    .meal-daytab-date { flex-direction: column; gap: 3px; font-size: .78rem; }
    .meal-card { padding: 12px 14px 14px; }
    .meal-card-body, .meal-parent .meal-card-body { grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); gap: 12px; align-items: start; }
    .meal-photo, .meal-parent .meal-photo { aspect-ratio: 4 / 3; }
    .meal-dish { padding: 9px 12px; font-size: .95rem; }
    .meal-allergens-label { display: none; }
    .meal-actions { gap: 10px; }
    .shell-content .meal-actions .btn:not(.btn-sm):not(.btn-icon) { flex: 1 1 0; min-width: 0; padding-inline: 8px; gap: 7px; font-size: .86rem; white-space: nowrap; }
    .meal-actions .btn-outline-primary i { display: none; }
    .shell-content .meal-actions .btn-primary:not(.btn-sm):not(.btn-icon) { flex-basis: 100%; order: -1; font-size: 1rem; }
    .meal-parent-head { gap: 14px; }
    .meal-daynav { gap: 14px; }
    .meal-daynav-label { font-size: 1.1rem; }
    .meal-card-dish { font-size: 1rem; }
}

/* Ordinateur : le carnet repas prend la largeur de la page (jamais une colonne de téléphone au milieu de l'écran) ;
   les repas du jour se rangent côte à côte, la semaine des parents se lit en colonnes, du lundi au vendredi */
@media (min-width: 992px) {
    .meal-book, .meal-parent { max-width: none; }
    .meal-switch { max-width: 460px; }
    .meal-cards { grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); }
    .meal-parent .meal-card-body { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
    .meal-week { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
}

/* --- Documents --- */
.doc-list { list-style: none; margin: 0; padding: 0; }
.doc-item { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--ui-border); }
.doc-item:last-child { border-bottom: 0; }
.doc-icon { flex: 0 0 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); }
.doc-meta { flex: 1; min-width: 160px; display: flex; flex-direction: column; }
.doc-meta a { text-decoration: none; color: var(--ui-text); }
.doc-meta small { color: var(--ui-muted); }
.doc-actions { display: flex; gap: 6px; }

/* --- Relevés / Pajemploi --- */
.pajemploi-fields { margin: 0; display: grid; gap: 2px; }
.pajemploi-field { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; }
.pajemploi-field:nth-child(odd) { background: var(--ui-surface-2); }
.pajemploi-field dt { font-weight: 500; font-size: .9rem; }
.pajemploi-field dt { min-width: 0; }
.pajemploi-field dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; flex: 0 0 auto; display: inline-flex; align-items: center; gap: 2px; }
.pajemploi-field [data-copy] { min-height: 0; min-width: 0; width: auto; box-shadow: none; line-height: 1; padding: 4px 6px !important; }
.calc-table td { padding: .5rem .25rem; }
.calc-table td.text-end { white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Téléphone : le tableau enveloppé pour le défilement garde ses libellés sur plusieurs lignes (montants entiers, sans défilement horizontal) */
.table-responsive > .calc-table td:not(.text-end) { white-space: normal; overflow-wrap: anywhere; }
.calc-table td.ps-3 { padding-left: 1rem !important; }

/* --- Revenus --- */
.income-chart { display: flex; align-items: flex-end; gap: 8px; height: 220px; padding-top: 10px; }
.income-bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; min-width: 0; }
.income-bar small { color: var(--ui-muted); font-size: .75rem; }
.income-bar-stack { width: 100%; max-width: 38px; display: flex; flex-direction: column; border-radius: 8px 8px 4px 4px; overflow: hidden; min-height: 2px; transition: height .8s var(--ui-ease); }
.income-bar-net { background: var(--accent); }
.income-bar-allow { background: var(--c-warm); }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: middle; }
.legend-net { background: var(--accent); }
.legend-allow { background: var(--c-warm); }
.regime-card { padding: 16px; border-radius: var(--ui-radius); border: 1px solid var(--ui-border); height: 100%; }
.regime-card.is-best { border-color: var(--c-ok); background: var(--c-ok-soft); }

/* --- Notifications --- */
.notif-list { list-style: none; margin: 0; padding: 6px; }
.notif-row { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--ui-radius); }
.notif-row:hover { background: var(--ui-surface-2); }
.notif-row.is-unread { background: var(--accent-soft); }
.notif-icon { flex: 0 0 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--ui-surface-2); color: var(--accent-strong); }
.min-w-0 { min-width: 0; }

/* --- Avis --- */
.stars { color: var(--c-warm); white-space: nowrap; }
.nanny-rating { font-size: .85rem; }
.review-item { padding: 12px 0; border-bottom: 1px solid var(--ui-border); }
.review-item:last-of-type { border-bottom: 0; }
.review-reply { margin: 6px 0; padding: 8px 12px; border-left: 3px solid var(--accent); background: var(--ui-surface-2); border-radius: 0 10px 10px 0; font-size: .9rem; }
.star-input { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.star-input input { position: absolute; opacity: 0; pointer-events: none; }
.star-input label { font-size: 1.6rem; color: var(--ui-border-strong, #ccc); cursor: pointer; transition: transform var(--ui-fast) var(--ui-ease), color var(--ui-fast); }
.star-input label:hover, .star-input label:hover ~ label, .star-input input:checked ~ label { color: var(--c-warm); }
.star-input label:hover { transform: scale(1.15); }
.star-input input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

/* --- Sécurité / preuves --- */
.recovery-codes { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; margin-top: 8px; }
.recovery-codes code { font-size: .95rem; background: var(--ui-surface); padding: 4px 8px; border-radius: 8px; text-align: center; }
.totp-qr { width: 200px; height: 200px; margin: 8px 0; background: #fff; padding: 8px; border-radius: 12px; border: 1px solid var(--ui-border); }
.totp-qr img, .totp-qr svg { width: 100%; height: 100%; }

/* Mes liaisons : une façon d'inviter par bloc (message, email, code remis en personne), et chaque invitation en attente */
.link-way { display: flex; flex-direction: column; align-items: flex-start; padding: 16px; border: 1px solid var(--ui-border); border-radius: 16px; background: var(--ui-surface); }
.link-way > form { width: 100%; }
/* Inviter un parent : trois tuiles « comment le joindre » (onglets d'app.js), puis le seul formulaire choisi (un champ, un bouton) et ses trois temps */
.link-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 12px; margin-bottom: 16px; }
.link-way-pick { display: flex; align-items: center; gap: 14px; min-height: 44px; padding: 14px 16px; border: 2px solid var(--line); border-radius: 16px; background: #FFFFFF; color: var(--ink-800); text-decoration: none; transition: border-color var(--ui-fast, .15s) var(--ui-ease, ease), background-color var(--ui-fast, .15s) var(--ui-ease, ease); }
.link-way-pick:hover, .link-way-pick:focus-visible, .link-way-pick.active { color: var(--ink-800); text-decoration: none; }
.link-way-pick:hover, .link-way-pick:focus-visible { border-color: var(--brand-300); }
.link-way-pick:focus-visible { outline: 0; box-shadow: var(--accent-ring); }
.link-way-pick.active { border-color: var(--brand-500); background: var(--brand-50); }
.link-way-pick-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.link-way-pick-text strong { font-weight: 800; }
.link-way-pick-text span { color: var(--muted); font-size: .88rem; }
.link-way-pane { padding: 20px; border-radius: 16px; background: var(--bg-2); }
.link-way-row { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.link-way-row > .form-control, .link-way-row > .form-select { flex: 1 1 260px; min-width: 0; }
.link-way-row > .btn { flex: none; }
.link-way-row > .form-text { flex: 1 1 100%; order: 3; margin-top: 0; }
.link-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; padding: 16px 0 0; border-top: 1px solid var(--line-strong); list-style: none; font-size: .88rem; color: var(--ink-700); }
.link-steps li { display: flex; align-items: flex-start; gap: 8px; }
.link-step-num { display: inline-grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; background: #FFFFFF; color: var(--brand-700); font-weight: 800; font-size: .8rem; box-shadow: 0 0 0 1px var(--brand-200); }
.link-steps li:last-child .link-step-num { background: var(--ok-100); color: var(--ok-700); box-shadow: 0 0 0 1px var(--ok-200); }
.link-invite-more { margin-top: 16px; }
.link-invite-more > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: .92rem; color: var(--brand-600); cursor: pointer; }
.link-invite-more > summary:hover { text-decoration: underline; }
@media (max-width: 575.98px) {
  /* Téléphone : les trois façons en une rangée compacte (pastille au-dessus du nom), l'explication passe dans les trois temps */
  .link-ways { gap: 8px; }
  .link-way-pick { flex-direction: column; gap: 8px; padding: 12px 6px; text-align: center; }
  .link-way-pick .ill-sticker { --s: 36px !important; }
  .link-way-pick-text strong { font-size: .88rem; }
  .link-way-pick-text span { display: none; }
  .link-way-pane { padding: 16px; }
  .link-way-row > .btn { flex: 1 1 100%; order: 4; margin-top: 4px; }
  .link-steps { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
code.hash { font-size: .75rem; word-break: break-all; }
.checklist { padding-left: 1.1rem; }
.checklist li { margin-bottom: 6px; }

/* --- Avenants et engagement réciproque --- */
.amend-table td:first-child { width: 38%; }
.amend-doc { max-width: 820px; margin: 0 auto; line-height: 1.6; }
.amend-doc .table td:first-child { width: 45%; }
.amend-doc .amended-legend { border-left: 2px solid var(--warn-500, #e0a100); padding-left: .3rem; }
.amend-doc .contract-document { margin-top: .75rem; }

/* --- Outils (pages/tools/, includes/tools_ui.php) : semaine type, chiffres clés, lettres --- */
/* Semaine type : un jour par ligne (nom, arrivée → départ, durée, Reporter, Effacer) ; sur une colonne étroite, les heures passent dessous */
.tool-week legend { font-size: inherit; }
.tool-days { container-type: inline-size; }
.tool-day { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "name hours actions" "times times times" "copy copy copy";
  gap: 4px 8px; align-items: center; padding: 8px 0; border-top: 1px solid var(--ui-border); }
.tool-day:first-child { border-top: 0; padding-top: 0; }
.tool-day-name { grid-area: name; font-weight: 700; font-size: .92rem; }
.tool-day-times { grid-area: times; display: flex; align-items: center; gap: 6px; }
.tool-day-times .form-control { flex: 1 1 0; min-width: 0; min-height: 40px; }
.tool-day-sep { color: var(--ui-muted); }
.tool-day-hours { grid-area: hours; min-width: 3.2em; text-align: right; font-weight: 700; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.tool-day.is-wrong .tool-day-hours { color: var(--ui-danger); }
.tool-day.is-wrong .form-control { border-color: var(--ui-danger); }
.tool-day-actions { grid-area: actions; display: inline-flex; gap: 2px; }
.tool-day-actions[hidden] { display: none; }
.tool-day.is-empty .tool-day-btn { visibility: hidden; }
.tool-day-btn { width: 40px; height: 40px; padding: 0; color: var(--ink-600); border: 1px solid transparent; }
.tool-day-btn:hover, .tool-day-btn:focus-visible { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-200); }
.tool-day-btn[data-tool-clear]:hover, .tool-day-btn[data-tool-clear]:focus-visible { color: var(--ui-danger); background: var(--ui-danger-soft); border-color: transparent; }
.tool-day-btn[aria-expanded="true"] { color: var(--brand-700); background: var(--brand-50); border-color: var(--brand-200); }
.tool-day-copy { grid-area: copy; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 4px; padding: 10px; border-radius: 10px; background: var(--brand-50); }
.tool-day-copy[hidden] { display: none; }
.tool-day-copy-label { width: 100%; font-size: .85rem; font-weight: 600; color: var(--ink-700); }
.tool-day-copy .btn.is-done { color: var(--ok-700); border-color: var(--ok-500); background: var(--ok-50); }
.tool-day-copy-empty { width: 100%; }
@container (min-width: 480px) {
  .tool-day { grid-template-columns: 92px minmax(0, 1fr) auto auto; grid-template-areas: "name times hours actions" "copy copy copy copy"; }
}
.tool-week-total { margin: 8px 0 0; padding-top: 8px; border-top: 1px solid var(--line-strong); font-size: .92rem; }
/* Semaines A, B, C, D : nombre de semaines (boutons), puis une semaine à la fois (onglets) */
.tool-cycle-pick { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.tool-cycle-pick .btn { min-height: 44px; white-space: nowrap; border-radius: 12px; }
@media (max-width: 575.98px) { .tool-cycle-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tool-cycle-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.tool-cycle-tabs[hidden] { display: none; }
.tool-cycle-tab { min-height: 40px; padding: 6px 14px; border: 1px solid var(--ui-border-strong); border-radius: 999px; background: var(--ui-surface); color: var(--ink-700); font-weight: 700; font-size: .9rem; }
.tool-cycle-tab[aria-selected="true"] { border-color: var(--brand-500); background: var(--brand-500); color: #FFFFFF; }
.tool-cycle-tab:focus-visible { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.tool-cycle.is-tabbed .tool-week-legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.tool-week-grid { display: grid; grid-template-columns: minmax(84px, auto) 1fr 1fr; gap: 6px 8px; align-items: center; }
.tool-week-day { font-weight: 700; font-size: .92rem; }
/* Choix « Brut | Net » à côté d'un tarif ou d'un salaire (toolMoneyField(), toolBasisSwitch()) */
.tool-basis-row { display: flex; gap: 8px; align-items: stretch; }
.tool-basis-row > .form-control { flex: 1 1 auto; min-width: 0; }
.tool-basis { flex: 0 0 auto; }
.tool-basis .btn { min-width: 3.6rem; font-weight: 600; }
.tool-figures { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.tool-figure-list > div { padding: 8px 0; border-top: 1px solid var(--ui-border); }
.tool-figure-list > div:first-child { border-top: 0; padding-top: 0; }
.tool-figure-list dt { font-weight: 600; color: var(--ui-muted); font-size: .88rem; }
.tool-figure-list dd { margin: 0; }
.tool-figure-list dd strong { font-size: 1.1rem; font-weight: 800; }
.tool-figure-since { margin-left: 8px; font-size: .82rem; color: var(--ui-muted); white-space: nowrap; }
.tool-figure-note { display: block; font-size: .85rem; color: var(--ui-muted); }
.tool-letter { max-width: 760px; line-height: 1.6; }
.tool-letter-to { margin: 12px 0 12px 55%; }
.tool-letter-date { text-align: right; }
.tool-letter-mention { font-style: italic; }
.tool-letter-title { font-size: 1.2rem; font-weight: 800; text-align: center; margin-bottom: 16px; }
.tool-letter-lines { max-width: 460px; }
.tool-letter-sign { margin-top: 28px; margin-left: 55%; min-height: 70px; }
.tool-letter-receipt { margin-top: 12px; font-size: .9rem; }
@media print {
    /* Une lettre s'imprime seule : ni titre d'écran, ni cadre */
    body:has(.tool-letter) .ui-page-head { display: none !important; }
    .ui-card.tool-letter { border: 0 !important; padding: 0 !important; font-size: 11pt; max-width: none; }
    .tool-letter .qa-flag { display: none !important; }
}

/* --- Impression (relevés, attestations, certificats) ---
   Document structuré et dense, dans la tradition des pièces administratives : bandeau d'émetteur, titre plein, cadre
   d'identification « libellé / valeur », rubriques à bandeau teinté, tableaux quadrillés, pied de page référencé.
   Palette sobre (bleu nuit, gris bleuté) ; aucun emblème, logo ni charte d'une administration (voir uiPrintHeader()). */
.print-only { display: none; }
@page { size: A4; margin: 12mm 11mm 16mm; @bottom-right { content: "Page " counter(page) " / " counter(pages); font: 7pt Arial, Helvetica, sans-serif; color: #626674; } }
@media print {
    .shell-sidebar, .shell-topbar, .shell-footer, .toast-stack, .no-print, .page-progress, .skip-link, .alert-dismissible .btn-close { display: none !important; }
    .print-only { display: block; }
    .shell-main { margin: 0 !important; }
    .shell-content { padding: 0 !important; }
    html, body { background: #fff !important; }
    body { color: #1c1e26; font-family: Arial, Helvetica, sans-serif; font-size: 9pt; line-height: 1.35;
        -webkit-print-color-adjust: exact; print-color-adjust: exact; }
    a[href]::after { content: none !important; }
    a { color: inherit; text-decoration: none; }
    /* Pas d'animation d'apparition : tout est visible dès l'ouverture de l'aperçu */
    *, *::before, *::after { animation: none !important; transition: none !important; opacity: 1; }
    .shell-content .mb-4, .shell-content .mb-3 { margin-bottom: 8pt !important; }

    /* Bandeau d'émetteur, titre et cadre d'identification */
    .print-doc { margin: 0 0 8pt; }
    .print-doc-top { display: flex; justify-content: space-between; align-items: baseline; border-top: 4pt solid #1d2a4a; border-bottom: .75pt solid #1d2a4a; padding: 3pt 1pt; font-size: 7.5pt; color: #626674; }
    .print-doc-brand { font-size: 9pt; font-weight: 700; color: #1d2a4a; }
    .print-doc-title { margin: 6pt 0 0; padding: 6pt 8pt; background: #1d2a4a; color: #fff; text-align: center; text-transform: uppercase; letter-spacing: .03em; font-size: 13pt; font-weight: 700; }
    .print-doc-facts { display: flex; flex-wrap: wrap; margin: 0; border-left: .5pt solid #96a0b8; border-top: .5pt solid #96a0b8; }
    .print-doc-facts > div { flex: 1 1 90pt; border-right: .5pt solid #96a0b8; border-bottom: .5pt solid #96a0b8; }
    .print-doc-facts dt { margin: 0; padding: 2pt 5pt; background: #e9edf4; color: #1d2a4a; font-size: 6.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; border-bottom: .5pt solid #96a0b8; }
    .print-doc-facts dd { margin: 0; padding: 3pt 5pt; font-size: 9pt; font-weight: 700; }
    .print-doc-foot { position: fixed; left: 0; right: 0; bottom: 0; padding-top: 2pt; border-top: .5pt solid #96a0b8; font-size: 6.5pt; color: #626674; }

    /* Rubriques : cadre fin, bandeau de titre teinté */
    .ui-card, .card { box-shadow: none !important; background: #fff !important; border: .5pt solid #96a0b8 !important; border-radius: 0 !important; padding: 0 8pt 6pt !important; margin-bottom: 8pt !important; break-inside: avoid; }
    .ui-card:not(.amend-doc):not(.certificate) > h2, .ui-card:not(.amend-doc):not(.certificate) > div > h2, .ui-card:not(.amend-doc):not(.certificate) > h3 { margin: 0 -8pt 6pt !important; padding: 3pt 8pt; background: #e9edf4; color: #1d2a4a; border-bottom: .5pt solid #96a0b8; text-transform: uppercase; letter-spacing: .03em; font-size: 8pt !important; font-weight: 700; }
    .ui-card > h2 i, .ui-card > div > h2 i, .ui-card > h3 i, .stat-tile-icon { display: none; }
    .contract-document h3 { background: #1d2a4a !important; color: #fff !important; border-radius: 0 !important; text-transform: uppercase; letter-spacing: .03em; font-size: 8.5pt !important; padding: 3pt 6pt !important; }
    .contract-document h4 { color: #1d2a4a; border-bottom: .5pt solid #1d2a4a; padding-bottom: 1pt; }
    .ui-card.stat-tile, .ui-card.ui-empty { padding-top: 4pt !important; }
    .stat-tile-value { font-size: 12pt; }
    .ui-grid { gap: 6pt !important; }
    .ui-chip { background: none !important; color: #1c1e26 !important; border: .5pt solid #96a0b8; border-radius: 0; padding: 0 4pt; font-size: 7.5pt; }
    .alert { border: .5pt solid #96a0b8; border-radius: 0; background: #f5f6f9 !important; color: #1c1e26 !important; padding: 3pt 6pt; margin-bottom: 6pt; font-size: 8pt; }
    .shell-content .row { --bs-gutter-x: 10pt; --bs-gutter-y: 0; margin-left: -5pt !important; margin-right: -5pt !important; }
    .shell-content .row > [class*="col"] { padding-left: 5pt; padding-right: 5pt; }
    p { margin-bottom: 4pt; }
    .text-muted, .small.text-muted { color: #626674 !important; }

    /* Tableaux quadrillés, denses */
    .table-responsive { overflow: visible !important; }
    .table { width: 100%; border-collapse: collapse; margin-bottom: 4pt; font-size: 8.2pt; --bs-table-bg: transparent; }
    .table th, .table td { padding: 2pt 4pt !important; border: .5pt solid #96a0b8 !important; box-shadow: none !important; vertical-align: top; }
    .table thead th { background: #e9edf4 !important; color: #1d2a4a; font-size: 7.6pt; text-transform: uppercase; letter-spacing: .02em; }
    .table .table-active > td, .table tr.fw-bold > td, .table tr.fw-semibold > td { background: #f1f3f8 !important; }
    code.hash, code { font-size: 6.8pt; color: #1c1e26; background: none; word-break: break-all; }

    /* Estimation du coût de la garde, remise aux parents (simulateur, pages/assistant/payroll_tools.php). Le conteneur de la page
       (flex, défilant) couperait l'estimation au premier saut de page : conteneurs en blocs, sans défilement, à l'impression ;
       l'aide « Expliquer cet écran » ne s'imprime pas. */
    body:has(.sim-print), body:has(.sim-print) .shell, body:has(.sim-print) .shell-main, body:has(.sim-print) .shell-content { display: block !important; overflow: visible !important; height: auto !important; }
    .guide-fab, .guide-card { display: none !important; }
    .sim-print-facts { margin-bottom: 8pt !important; }
    .sim-print-summary { display: flex; gap: 6pt; margin: 0 0 8pt; break-inside: avoid; }
    .sim-print-summary > div { flex: 1 1 0; border: .5pt solid #96a0b8; padding: 5pt 7pt; }
    .sim-print-summary span { display: block; font-size: 7pt; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: #1d2a4a; }
    .sim-print-summary strong { display: block; margin: 3pt 0 1pt; font-size: 13pt; }
    .sim-print-summary small { display: block; font-size: 7pt; color: #626674; }
    .sim-print-summary > .is-main { background: #1d2a4a; border-color: #1d2a4a; }
    .sim-print-summary > .is-main span, .sim-print-summary > .is-main strong, .sim-print-summary > .is-main small { color: #fff; }
    .sim-print-note { margin-top: 8pt; font-size: 7.5pt; }

    /* Documents rédigés (avenants, engagement réciproque, certificat) */
    .amend-doc, .certificate { max-width: none; line-height: 1.4; font-size: 8.8pt; padding-top: 6pt !important; }
    .amend-doc > h2:first-child, .amend-doc > h2:first-child + p.text-center, .certificate h2 { display: none; }
    .amend-doc p { text-align: justify; }
}

@media (max-width: 576px) {
    .journal-toolbar { flex-direction: column; align-items: stretch; }
    .journal-date { justify-content: space-between; }
    .check-forms, .check-row form { width: 100%; flex-wrap: wrap; }
    .check-time { flex: 1 1 110px; width: auto; min-width: 104px; }
    .check-row form .btn { flex: 0 0 auto; padding-left: .6rem; padding-right: .6rem; }
    .income-chart { gap: 4px; height: 180px; }
}

/* --- Actualités : assets/css/news.css --- */

/* Recherche : alerte de place (champ + bouton) sur toute la largeur en mobile */
@media (max-width: 576px) {
    .alert-box-form { width: 100%; }
    .alert-box-form .form-control { flex: 1; min-width: 0; }
    .alert-box-form .btn { flex: 0 0 auto; }
}

/* Notifications : la date passe sous le texte sur mobile */
@media (max-width: 576px) {
    .notif-row { flex-wrap: wrap; align-items: flex-start; }
    .notif-row > .flex-grow-1 { flex: 1 1 0; min-width: 0; }
    .notif-row time { flex-basis: 100%; padding-left: 50px; margin-top: -6px; }
}

/* ===== Contrats : aperçu, conformité et signature électronique ===== */
.sign-steps { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.25rem; }
.sign-steps li { display: flex; align-items: center; gap: .5rem; padding: .45rem .9rem; border-radius: 999px;
    background: var(--bg-2, #eef2f7); color: var(--muted, #626b7a); font-weight: 600; font-size: .9rem; }
.sign-steps li span { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%;
    background: #fff; font-size: .8rem; }
.sign-steps li.is-current { background: var(--brand-100, #dceafa); color: var(--brand-700, #1f4e85); }
.sign-steps li.is-done { background: var(--ok-100, #d2eee1); color: var(--ok-700, #236a4e); }
.contract-preview { max-height: 60vh; overflow-y: auto; border: 1px solid var(--line, #e3eaf2); border-radius: 12px;
    padding: 1.25rem; background: #fff; }
.contract-document { font-size: .95rem; line-height: 1.55; color: var(--ink-700, #2b3445); }
.contract-document-title { font-size: 1.25rem; font-weight: 800; text-align: center; text-transform: uppercase; margin-bottom: .25rem; }
.contract-document-subtitle { text-align: center; color: var(--muted, #626b7a); font-size: .85rem; }
.contract-document section { margin-top: 1.25rem; }
.contract-document h3 { font-size: 1rem; font-weight: 700; color: var(--brand-700, #1f4e85); background: var(--brand-50, #eef5fd);
    padding: .4rem .7rem; border-radius: 8px; }
.contract-document h4 { font-size: .92rem; font-weight: 700; margin: .9rem 0 .3rem; }
.contract-document p { text-align: justify; margin-bottom: .5rem; }
.contract-kv { display: grid; grid-template-columns: minmax(10rem, 34%) 1fr; margin: 0 0 .6rem; }
.contract-kv dt, .contract-kv dd { padding: .3rem 0; border-top: 1px solid var(--line, #e3eaf2); margin: 0; }
.contract-kv dt { font-weight: 600; color: var(--muted, #626b7a); padding-right: .75rem; }
.contract-document .amended-badge { display: inline-block; margin-left: .4rem; padding: .05rem .5rem; border-radius: 999px; font-size: .75rem;
    font-weight: 700; background: var(--warn-100, #fdf0d2); color: var(--warn-700, #7a5406); vertical-align: middle; }
.contract-document p.is-amended, .contract-document ul.is-amended, .contract-document table.is-amended,
.contract-kv dt.is-amended, .contract-kv dd.is-amended { background: var(--warn-50, #fff8e6); box-shadow: inset 3px 0 0 var(--warn-500, #e0a100); }
.contract-document p.is-amended, .contract-document ul.is-amended, .contract-kv dt.is-amended { padding-left: .55rem; }
.contract-kv dd.is-amended { font-weight: 600; box-shadow: none; }
@media print {
    .contract-document p.is-amended, .contract-document ul.is-amended, .contract-document table.is-amended,
    .contract-kv dt.is-amended, .contract-kv dd.is-amended { background: none; border-left: 2px solid #999; box-shadow: none; }
}
.signature-pad-wrap { position: relative; max-width: 600px; }
.signature-pad { width: 100%; height: auto; aspect-ratio: 10 / 3; border: 2px dashed var(--line-strong, #d2dce8); border-radius: 12px;
    background: #fff; touch-action: none; cursor: crosshair; display: block; }
.signature-clear { position: absolute; top: .5rem; right: .5rem; }
.sign-code { font-size: 1.2rem; letter-spacing: .3em; font-variant-numeric: tabular-nums; }
.sign-consent { padding: .9rem 1rem .9rem 2.4rem; border-radius: 12px; background: var(--warm-50, #fff8e6); }
.change-request summary { cursor: pointer; }
@media (max-width: 575.98px) {
    .contract-preview { padding: .85rem; max-height: 55vh; }
    .contract-kv { grid-template-columns: 1fr; }
    .contract-kv dt { border-top: 1px solid var(--line, #e3eaf2); padding-bottom: 0; }
    .contract-kv dd { border-top: 0; padding-top: .1rem; }
    .sign-steps li { font-size: .8rem; padding: .35rem .7rem; }
}

/* ===== Fiche de présence (pages/attendance_sheet.php) et étapes du mois (relevé) ===== */
.sheet-steps li { border-radius: 14px; align-items: center; }
.sheet-steps li div { display: flex; flex-direction: column; line-height: 1.15; }
.sheet-steps li strong { font-size: .85rem; }
.sheet-steps li small { font-weight: 600; font-size: .75rem; color: var(--ink-500); }
.sheet-steps li.is-current { box-shadow: inset 0 0 0 2px var(--brand-300, #9cc3ee); }
/* Étape cliquable : toute la pastille mène à l'endroit où l'étape se fait */
.sheet-steps li { position: relative; }
.sheet-step-link { display: flex; align-items: center; gap: .5rem; color: inherit; text-decoration: none; }
.sheet-step-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.sheet-step-link:hover strong, .sheet-step-link:focus-visible strong { text-decoration: underline; }
.sheet-step-link:focus-visible { outline: none; }
.sheet-step-link:focus-visible::after { outline: 2px solid var(--brand-700, #1f4e85); outline-offset: 2px; }
.sheet-help summary { cursor: pointer; color: var(--ui-muted); font-weight: 600; }
.sheet-help ul { padding-left: 1.2rem; display: grid; gap: 4px; }
.sheet-month-nav .form-select { min-width: 10.5rem; }
.sheet-screens { display: inline-flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--ui-surface-2); font-size: .85rem; }
.sheet-screens a { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .85rem; border-radius: 999px; color: var(--ui-muted); text-decoration: none; font-weight: 600; }
.sheet-screens a b { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--ui-surface); font-size: .75rem; }
.sheet-screens a.is-active { background: var(--brand-100, #dceafa); color: var(--brand-700, #1f4e85); }
.sheet-screens a.is-active b { background: var(--brand-500, #2f6fb5); color: #fff; }
.sheet-locked { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .6rem .85rem;
    border-radius: var(--ui-radius, 12px); background: var(--ui-surface-2); }
/* Vue semaine de la fiche de présence (maquette « Présences ») : une carte par semaine, une tuile par jour (pictogramme, état en texte
   simple, durée, horaires), en lignes compactes quand la place manque (téléphone) ; à l'impression, un tableau. Couleurs de la palette. */
.sheet-card-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: 1rem; }
.sheet-card-title { display: flex; align-items: center; gap: .85rem; min-width: 0; }
.sheet-title { margin: 0; font-size: 1.35rem; font-weight: 900; }
.sheet-print { min-width: 2.4rem; }
.sheet-table .sheet-plan-label { display: none; }
@media screen {
    .sheet-card { container: sheet / inline-size; }
    .sheet-weeks-wrap { margin: 0; }
    .sheet-table.table { margin: 0; background: transparent; --bs-table-bg: transparent; }
    .sheet-table, .sheet-table > tbody { display: block; width: 100%; }
    .sheet-table > thead { display: none; }
    .sheet-table.table > tbody > tr > * { padding: 0; border: 0; background: transparent; box-shadow: none; }
    .sheet-week-group { padding: 4px 0 14px; }
    .sheet-week-group + .sheet-week-group { border-top: 1px solid var(--line); padding-top: 14px; }
    .sheet-table tr.sheet-week { display: block; }
    .sheet-table tr.sheet-week > th { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; padding: 0 2px 10px; font-weight: 800;
        font-size: .95rem; color: var(--ink-700); }
    .sheet-week-name::first-letter { text-transform: uppercase; }
    .sheet-week-total { margin-left: auto; font-weight: 900; color: var(--ink-700); font-variant-numeric: tabular-nums; }
    /* Jour : ligne compacte (date, pictogramme et état, durée, actions) */
    .sheet-table tr[data-sheet-day] { display: grid; grid-template-columns: 3rem 2.2rem minmax(0, 1fr) auto; grid-template-areas: "date ico done hours" "date ico plan actions";
        align-items: center; gap: .15rem .6rem; padding: .55rem .7rem; margin-bottom: 8px; border: 1px solid var(--line); border-radius: var(--r-md, 16px);
        background: var(--ui-surface, #FFFFFF); scroll-margin-top: calc(var(--topbar-h) + 24px); }
    .sheet-table td.sheet-date { grid-area: date; display: flex; flex-direction: column; line-height: 1.15; }
    .sheet-dow { font-weight: 900; color: var(--ink-700); }
    .sheet-dnum { font-size: .78rem; color: var(--muted); }
    .sheet-table td.sheet-done { display: contents; }
    .sheet-ico { grid-area: ico; display: grid; place-items: center; }
    .sheet-ico .ill { width: 34px; height: 34px; }
    .sheet-table td.sheet-done > :not(.sheet-ico) { grid-column: 3; min-width: 0; }
    .sheet-state { font-size: .88rem; font-weight: 800; color: var(--muted); }
    .sheet-state.is-ok { color: var(--ok-600); }
    .sheet-state.is-todo, .sheet-state.is-changed { color: var(--c-warm-deep); }
    .sheet-state i { margin-right: .15rem; }
    .sheet-times { font-size: .8rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .sheet-state + .sheet-times::before { content: "· "; }
    .sheet-table td.sheet-plan { grid-area: plan; font-size: .78rem; color: var(--faint); font-variant-numeric: tabular-nums; }
    .sheet-table td.sheet-plan.is-same, .sheet-table td.sheet-plan.is-empty { display: none; }
    /* Jour à valider : « Valider » et « Modifier » sur une ligne à eux (la place manque à côté de l'état) */
    .sheet-table tr.is-missing:has(.sheet-check) { grid-template-areas: "date ico done hours" "date ico plan plan" "actions actions actions actions"; }
    .sheet-table .sheet-plan-label { display: inline; }
    .sheet-table td.sheet-hours { grid-area: hours; text-align: right; font-weight: 900; font-size: 1.05rem; color: var(--ink-700); font-variant-numeric: tabular-nums; white-space: nowrap; }
    .sheet-table td.sheet-row-actions { grid-area: actions; display: flex; justify-content: flex-end; gap: .35rem; }
    .sheet-row-actions .btn { min-height: 2.6rem; min-width: 2.6rem; font-weight: 800; border-radius: var(--r-pill, 999px); }
    .sheet-row-actions .sheet-edit { border: 1px solid var(--line-strong); background: var(--ui-surface, #FFFFFF); }
    .sheet-row-actions .sheet-check { background: var(--ui-surface, #FFFFFF); border: 1px solid var(--ok-500); color: var(--ok-600); }
    .sheet-row-actions .sheet-check:hover, .sheet-row-actions .sheet-check:focus-visible { background: var(--ok-500); border-color: var(--ok-500); color: #FFFFFF; }
    .sheet-edit-text { display: none; }
    .sheet-leave-link, .sheet-proof { font-size: .76rem; }
    /* Journée d'adaptation : liseré en haut du jour et mention « Adaptation » (heures non faites déduites) */
    .sheet-table tr[data-adaptation] { border-top: 3px solid var(--c-warm); }
    .sheet-adaptation { display: block; font-size: .76rem; font-weight: 700; color: var(--c-warm-deep); }
    /* États : à valider (chaud), aujourd'hui (couleur principale), absence ou non travaillé (en retrait) */
    .sheet-table tr.is-missing { border-color: var(--warm-300); background: var(--warm-50); }
    .sheet-table tr.is-changed { border-color: var(--warm-200); }
    .sheet-table tr.is-today { box-shadow: 0 0 0 2px var(--brand-300); }
    .sheet-table tr.is-absent, .sheet-table tr.is-holiday { background: var(--bg-2); }
    .sheet-table tr.sheet-off { background: var(--bg); border-style: dashed; }
    .sheet-table tr.sheet-off .sheet-ico, .sheet-table tr.is-future .sheet-ico { opacity: .5; }
    .sheet-table tr.sheet-off td.sheet-plan, .sheet-table td.sheet-plan.is-off { font-style: italic; }
    /* Pied de semaine : jours à valider et « Valider la semaine », ou semaine complète */
    .sheet-table tr.sheet-week-foot { display: block; }
    .sheet-table tr.sheet-week-foot > td { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem;
        padding: .6rem .8rem; border-radius: var(--r-md, 16px); background: var(--warm-50); }
    .sheet-week-todo { font-weight: 800; color: var(--c-warm-deep); font-size: .9rem; }
    .sheet-week-foot .btn { border-radius: var(--r-pill, 999px); font-weight: 800; min-height: 2.6rem; padding-inline: 1.1rem; }
    .sheet-table tr.sheet-week-foot > td:has(.sheet-week-done) { background: transparent; padding: 0 2px; }
    .sheet-week-done { font-weight: 800; font-size: .85rem; color: var(--ok-600); }

    /* Assez de place : la semaine en tuiles basses côte à côte, sur toute la largeur (jours non travaillés plus étroits) :
       date et pictogramme en haut, état et durée sur une ligne, horaires, puis les boutons ; « Valider » perd son libellé
       (gardé pour les lecteurs d'écran et en infobulle) seulement si la tuile est trop étroite */
    @container sheet (min-width: 700px) {
        .sheet-table > tbody.sheet-week-group { display: flex; flex-wrap: wrap; gap: 8px; }
        .sheet-table tr.sheet-week, .sheet-table tr.sheet-week-foot { flex: 0 0 100%; }
        .sheet-table tr.sheet-week > th { padding-bottom: 0; }
        .sheet-table tr[data-sheet-day] { container: sheetday / inline-size; flex: 1 1 0; min-width: 0; max-width: 15rem; margin: 0; display: grid;
            grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: repeat(6, auto) 1fr; align-items: center; gap: 0 4px;
            padding: 8px 9px; text-align: left; }
        .sheet-table tr.sheet-off { flex-grow: .85; max-width: 12rem; }
        .sheet-table tr.sheet-off td.sheet-hours { display: none; }
        .sheet-table td.sheet-date { grid-area: 1 / 1; flex-direction: row; white-space: nowrap; align-items: baseline; gap: 3px; font-size: .92rem; }
        .sheet-dnum { font-size: .85rem; }
        .sheet-dmon { display: none; }
        .sheet-ico { grid-area: 1 / 2; }
        .sheet-ico .ill { width: 26px; height: 26px; }
        .sheet-table td.sheet-done > :not(.sheet-ico) { grid-column: 1; grid-row: 2; }
        .sheet-state { font-size: .84rem; line-height: 1.2; overflow-wrap: break-word; margin-top: 2px; }
        .sheet-state i { display: none; }
        .sheet-table td.sheet-hours { grid-area: 2 / 2; text-align: right; font-size: 1.1rem; line-height: 1.2; margin-top: 2px; }
        .sheet-table td.sheet-done > .sheet-times { grid-area: 3 / 1 / 4 / 3; font-size: .78rem; }
        .sheet-state + .sheet-times::before { content: none; }
        .sheet-table td.sheet-plan { grid-area: 4 / 1 / 5 / 3; font-size: .78rem; line-height: 1.25; }
        .sheet-table .sheet-plan-label { display: none; }
        .sheet-table tr.is-changed .sheet-plan-label { display: inline; }
        .sheet-table td.sheet-done > .sheet-leave-link { grid-area: 5 / 1 / 6 / 3; }
        .sheet-table td.sheet-done > .sheet-adaptation { grid-area: 5 / 1 / 6 / 3; line-height: 1.25; }
        .sheet-table td.sheet-done > .sheet-proof, .sheet-table td.sheet-done > .sheet-note { grid-area: 6 / 1 / 7 / 3; }
        .sheet-leave-link, .sheet-proof { font-size: .78rem; line-height: 1.25; }
        .sheet-table td.sheet-row-actions { grid-area: 7 / 1 / 8 / 3; align-self: end; padding-top: 6px; flex-wrap: nowrap; justify-content: flex-start; gap: 4px; }
        .sheet-row-actions .btn { min-height: 2.1rem; min-width: 2.1rem; padding: 0 .55rem; font-size: .82rem; }
        .sheet-check-text { display: none; }
        .sheet-table tr.sheet-week-foot > td { padding: .45rem .8rem; }
        .sheet-week-foot .btn { min-height: 2.25rem; }
    }
    @container sheetday (min-width: 150px) {
        .sheet-check-text { display: inline; }
    }
}
@media print {
    .sheet-ico, .sheet-print { display: none !important; }
    .sheet-table tr.sheet-off { display: none !important; }
    .sheet-table tr.sheet-week th { background: none; font-weight: 700; }
    .sheet-week-total { float: right; }
    .sheet-dnum::before { content: " "; }
    .sheet-state + .sheet-times::before { content: " · "; }
}

/* Écrans de la fiche et navigation entre les mois : pastilles comme sur la maquette */
.sheet-screens a i { font-size: .85em; }
.sheet-month-nav { padding: 3px; border-radius: var(--r-pill, 999px); background: var(--ui-surface, #FFFFFF); border: 1px solid var(--line); }
.sheet-month-nav .btn { border-radius: 50%; width: 2.25rem; height: 2.25rem; display: inline-grid; place-items: center; padding: 0; background: transparent; border: 0; }
.sheet-month-nav .form-select { border: 0; font-weight: 800; background-color: transparent; box-shadow: none; }

/* Fenêtre « Modifier » d'un jour : choix illustrés, horaires, durée */
.sheet-day .modal-header { border-bottom: 0; padding-bottom: .25rem; }
.sheet-day-title { display: flex; align-items: center; gap: .6rem; font-size: 1.15rem; font-weight: 900; margin: 0; }
.sheet-day-title-ico { display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: var(--r-sm, 12px); background: var(--ok-50); color: var(--ok-600); }
.sheet-kinds { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 1rem; padding: 0; border: 0; }
.sheet-kind { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 96px; padding: 12px 6px; cursor: pointer;
    border: 1px solid var(--line); border-radius: var(--r-md, 16px); background: var(--ui-surface, #FFFFFF); font-weight: 800; color: var(--ink-700); text-align: center; }
.sheet-kind .ill { width: 40px; height: 40px; }
.sheet-kind:hover { border-color: var(--line-strong); box-shadow: var(--ui-shadow-xs); }
.btn-check:checked + .sheet-kind { border: 2px solid var(--ok-500); background: var(--ok-50); }
.btn-check:focus-visible + .sheet-kind { outline: 2px solid var(--brand-500); outline-offset: 2px; }
.sheet-day-sub { font-weight: 800; margin: 0 0 .5rem; color: var(--ink-700); }
.sheet-planned { display: inline-flex; align-items: center; gap: .6rem; padding: .5rem .9rem; margin-bottom: .75rem; border: 1px solid var(--ok-300); border-radius: var(--r-md, 16px);
    background: var(--ok-50); color: var(--ink-700); text-align: left; }
.sheet-planned > i { color: var(--ok-600); }
.sheet-planned span { display: flex; flex-direction: column; line-height: 1.2; }
.sheet-planned small { color: var(--muted); font-variant-numeric: tabular-nums; }
.sheet-planned:hover { border-color: var(--ok-500); }
.sheet-day-times { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.sheet-time { padding: .5rem .7rem; border-radius: var(--r-md, 16px); background: var(--bg-2); }
.sheet-time .form-label { margin-bottom: .2rem; font-weight: 800; }
.sheet-time .form-control { font-size: 1.15rem; font-weight: 800; font-variant-numeric: tabular-nums; border-radius: var(--r-sm, 12px); }
.sheet-duration { display: flex; align-items: center; gap: .5rem; margin: .75rem 0 .25rem; padding: .55rem .9rem; border-radius: var(--r-md, 16px);
    background: var(--warm-50); color: var(--ink-700); font-size: .9rem; }
.sheet-duration strong { font-weight: 900; }
.sheet-day .modal-footer { border-top: 0; }
.sheet-day .modal-footer .btn { border-radius: var(--r-pill, 999px); font-weight: 800; }
.sheet-day .modal-footer .btn-primary { padding-inline: 1.4rem; }

/* Effet d'un jour sur le salaire, entre parenthèses : payé (vert), déduit (chaud), non déduit (principal) ; commentaire de l'assistante */
.sheet-effect { font-weight: 700; font-size: .92em; white-space: normal; }
.sheet-effect.is-paid { color: var(--ok-600); }
.sheet-effect.is-deducted, .sheet-effect.is-partial, .sheet-effect.is-conditional { color: var(--c-warm-deep); }
.sheet-effect.is-waived { color: var(--brand-600); }
.sheet-note { color: var(--ink-700); font-style: italic; line-height: 1.25; overflow-wrap: anywhere; }
/* Fenêtre « Modifier » : cas d'absence en cascade, chacun avec son effet et sa règle dessous */
.sheet-cases, .sheet-deduct fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.sheet-case { display: flex; align-items: flex-start; gap: .55rem; padding: .5rem .7rem; margin-bottom: 6px; border: 1px solid var(--line); border-radius: var(--r-md, 16px);
    background: var(--ui-surface, #FFFFFF); }
.sheet-case .form-check-input { flex: 0 0 auto; margin-top: .2rem; }
.sheet-case:has(.form-check-input:checked) { border-color: var(--ok-500); background: var(--ok-50); }
.sheet-case-label { flex: 1 1 auto; min-width: 0; font-weight: 800; color: var(--ink-700); cursor: pointer; }
.sheet-case-why { display: block; margin-top: 2px; font-weight: 400; font-size: .82rem; color: var(--muted); line-height: 1.3; }
.sheet-case-source { display: inline-block; font-style: italic; color: var(--faint); }
.sheet-case-source::before { content: "· "; }

/* Écran « Valider le mois » : un mot illustré, puis le bilan */
.sheet-month { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 16px; }
.sheet-month-art { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .75rem; text-align: center;
    background: var(--warm-50); padding: 24px; }
.sheet-month-art .ill-rays { position: absolute; top: calc(50% - 78px); left: calc(50% + 34px); }
.sheet-month-msg { margin: 0; font-weight: 900; font-size: 1.1rem; color: var(--ink-700); max-width: 18rem; }
.sheet-month-list { margin: 0; padding: 8px 20px; }
.sheet-month-list li { display: flex; align-items: center; gap: .85rem; padding: .7rem 0; }
.sheet-month-list li + li { border-top: 1px solid var(--line); }
.sheet-month-ico { flex: none; display: inline-grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--bg-2); color: var(--ink-500); }
.sheet-month-list li.is-ok .sheet-month-ico { background: var(--ok-50); color: var(--ok-600); }
.sheet-month-list li.is-todo .sheet-month-ico { background: var(--warm-100); color: var(--c-warm-deep); }
.sheet-month-label { flex: 1; min-width: 0; font-weight: 800; color: var(--ink-700); line-height: 1.25; }
.sheet-month-label small { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.sheet-month-value { font-weight: 900; font-size: 1.1rem; color: var(--ink-700); text-align: right; font-variant-numeric: tabular-nums; }
.sheet-validate [data-validate-sheet] { border-radius: var(--r-pill, 999px); font-weight: 800; padding: .6rem 1.4rem; }
@media (max-width: 767.98px) {
    .sheet-month { grid-template-columns: 1fr; }
    .sheet-month-art { flex-direction: row; text-align: left; padding: 14px 16px; }
    .sheet-month-art .ill-icon { width: 56px; height: 56px; flex: none; }
    .sheet-month-art .ill-rays { display: none; }
    .sheet-month-list { padding: 4px 14px; }
}
/* Semaines A/B/C du cycle : planificateur compact (une ligne par mois, une pastille par semaine) */
.cycle-plan { padding: .6rem .9rem; }
.cycle-plan > summary { display: flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none; flex-wrap: wrap; }
.cycle-plan > summary::-webkit-details-marker { display: none; }
.cycle-plan-peek { display: inline-flex; gap: 3px; }
.cycle-plan-peek b, .cycle-chip { --cy-bg: var(--brand-50, #eef5fd); --cy-fg: var(--brand-700, #1f5fa8); }
.cycle-plan-peek b { width: 1.35rem; height: 1.35rem; border-radius: 6px; display: inline-grid; place-items: center; font-size: .75rem;
    background: var(--cy-bg); color: var(--cy-fg); }
.cycle-plan-peek b[data-letter="B"], .cycle-chip[data-letter="B"] { --cy-bg: #fff3d6; --cy-fg: #8a5a00; }
.cycle-plan-peek b[data-letter="C"], .cycle-chip[data-letter="C"] { --cy-bg: #e3f6ea; --cy-fg: #1d6b3c; }
.cycle-plan-peek b[data-letter="D"], .cycle-chip[data-letter="D"] { --cy-bg: #f1e8fb; --cy-fg: #6236a0; }
.cycle-plan-ranges { display: inline-flex; gap: 2px; margin: .55rem 0 .4rem; padding: 2px; border-radius: 999px; background: var(--ui-surface-2); font-size: .78rem; }
.cycle-plan-ranges a { padding: .15rem .6rem; border-radius: 999px; color: var(--ui-muted); text-decoration: none; }
.cycle-plan-ranges a.is-active { background: var(--ui-surface); color: var(--ui-text); font-weight: 600; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.cycle-plan-month { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 3px 0; }
.cycle-plan-label { width: 2.9rem; font-size: .75rem; font-weight: 600; color: var(--ui-muted); text-transform: capitalize; }
.cycle-chip { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 2.75rem; height: 2.5rem; padding: 0;
    border: 0; border-radius: 8px; background: var(--cy-bg); color: var(--cy-fg); line-height: 1.05; cursor: pointer; }
.cycle-chip small { font-size: .75rem; }
.cycle-chip b { font-size: .9rem; }
.cycle-chip:disabled { cursor: default; opacity: .55; }
.cycle-chip[data-touched] { box-shadow: inset 0 0 0 2px currentColor; }
.cycle-chip:focus-visible { outline: 2px solid var(--brand-400, #4a8fd9); outline-offset: 1px; }
.cycle-plan-foot { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .8rem; margin-top: .45rem; }
.cycle-plan-foot .btn { margin-left: auto; }
.sheet-confirm { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; margin-bottom: .9rem;
                 padding: .65rem .85rem; border-radius: var(--ui-radius, 12px); background: var(--warn-50, #fff8e6); border: 1px solid var(--warn-200, #f5dc9a); }
.sheet-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem;
    margin: 1rem -20px -20px; padding: .8rem 20px; background: var(--ui-surface);
    border-top: 1px solid var(--ui-border); border-radius: 0 0 var(--ui-radius-lg) var(--ui-radius-lg); }
.sheet-saving { display: block; color: var(--ui-muted); margin-top: 2px; }
.sheet-unsaved { display: block; color: var(--ui-danger, #b42318); font-weight: 600; margin-top: 2px; }
@media (max-width: 576px) {
    .sheet-steps { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .25rem; scroll-snap-type: x proximity; }
    .sheet-steps li { flex: 0 0 auto; scroll-snap-align: start; }
    .sheet-month-nav { width: 100%; }
    .sheet-month-nav .form-select { flex: 1; min-width: 0; }
    .sheet-screens { width: 100%; }
    .sheet-screens a { flex: 1; justify-content: center; padding: .4rem .5rem; }
    .sheet-confirm .btn { width: 100%; min-height: 2.6rem; }
    .sheet-actions { margin: 1rem -12px -16px; padding: .7rem 12px; }
    .sheet-actions .btn { flex: 1 1 auto; min-height: 2.6rem; }
}

/* Heures avant la reprise (QA-0019) : une ligne par mois, champs d'heures lisibles quand le tableau défile sur mobile */
[data-history-months] input[type="number"] { min-width: 5.5rem; }
