/* ── fiche-evenement-securite-v830 (ajouté en V8.3.0) ──
   Fiche détaillée d’un événement du planning, même présentation que dans Audiovisuel, en bordeaux Sécurité.
   --campus : couleur du site (donnée par siteColour), utilisée pour le talon de date et le liseret.
   La fiche n’utilise ni <header> ni <footer> : Sécurité a des règles globales sur ces balises (bandeau rouge). */
.sec-ev-dialog {
  --campus: #9f1239;
  --sec-accent: #9f1239;
  --sec-accent-dark: #6b0d24;
  --sec-soft: #fff1f3;
  --sec-ink: #2f1d22;
  --sec-muted: #6b5a5f;
  --sec-line: #ead9de;
  width: min(1200px, calc(100vw - 32px));
  max-height: calc(100vh - 40px);
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--sec-ink);
  box-shadow: 0 34px 90px #2b0a1466;
  overflow: hidden;
  font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.sec-ev-dialog[open] { display: flex; flex-direction: column; }
.sec-ev-dialog::backdrop { background: #2b0a1499; backdrop-filter: blur(3px); }
@media (prefers-reduced-motion: no-preference) {
  .sec-ev-dialog[open] { animation: secEvOpen .22s ease-out; }
  @keyframes secEvOpen { from { opacity: 0; transform: translateY(10px) scale(.985); } }
}

/* En-tête : talon de date à la couleur du site, titre, pastilles de sécurité */
.sec-ev-hero { display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; background: var(--sec-soft); border-bottom: 1px solid var(--sec-line); }
.sec-ev-stub { display: flex; flex-direction: column; justify-content: center; min-width: 150px; padding: 20px 26px; background: var(--campus); color: #fff; text-align: center; text-shadow: 0 1px 2px #0003; }
.sec-ev-stub-weekday { font-size: 13px; font-weight: 700; }
.sec-ev-stub-weekday::first-letter { text-transform: uppercase; }
.sec-ev-stub-day { font-size: 54px; font-weight: 900; line-height: 1; letter-spacing: -.03em; margin: 4px 0; }
.sec-ev-stub-month { font-size: 14px; font-weight: 700; }
.sec-ev-hero-text { align-self: center; padding: 22px 28px; min-width: 0; }
.sec-ev-dialog.sec-ev-dialog .sec-ev-kind { margin: 0 0 6px; color: var(--sec-muted); font-size: 14px; font-weight: 700; }
.sec-ev-dialog.sec-ev-dialog .sec-ev-hero-text h3 { margin: 0; color: var(--sec-ink); font-size: clamp(22px, 2.4vw, 32px); line-height: 1.15; letter-spacing: -.01em; overflow-wrap: anywhere; }
/* Le réglage « taille du texte » (css/accessibilite.css) fixe tous les h3 à 1,25 rem : le titre garde sa taille, en rem pour suivre ce réglage. */
html[data-text-scale] .sec-ev-dialog.sec-ev-dialog .sec-ev-hero-text h3 { font-size: clamp(1.4rem, 2.4vw, 2rem) !important; }
.sec-ev-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sec-ev-badge { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--sec-line); color: var(--sec-muted); font-size: 12px; font-weight: 800; }
.sec-ev-badge.is-guard { background: #b51131; border-color: #b51131; color: #fff; }
.sec-ev-badge.is-public { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.sec-ev-badge.is-shift { background: #ecfdf3; border-color: #86efac; color: #166534; }
.sec-ev-close { align-self: start; margin: 16px 16px 0 0; width: 40px; height: 40px; border: 1px solid var(--sec-line); border-radius: 50%; background: #fff; color: var(--sec-ink); font-size: 16px; cursor: pointer; }
.sec-ev-close:hover { background: var(--sec-soft); }
.sec-ev-dialog :focus-visible { outline: 3px solid #f59e0b; outline-offset: 2px; }

/* Corps */
.sec-ev-body { padding: 22px 28px 26px; overflow: auto; }
.sec-ev-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border: 1px solid var(--sec-line); border-radius: 12px; margin-bottom: 22px; }
.sec-ev-fact { display: flex; flex-direction: column; gap: 3px; padding: 14px 18px; }
.sec-ev-fact + .sec-ev-fact { border-left: 1px solid var(--sec-line); }
.sec-ev-fact-label { color: var(--sec-muted); font-size: 12px; font-weight: 700; }
.sec-ev-fact strong { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.sec-ev-fact-sub { color: var(--sec-muted); font-size: 13px; }
.sec-ev-grid { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 26px; align-items: start; }
.sec-ev-main, .sec-ev-side { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.sec-ev-dialog.sec-ev-dialog .sec-ev-block h4 { margin: 0 0 10px; color: var(--sec-ink); font-size: 15px; font-weight: 800; }
.sec-ev-side .sec-ev-block { padding-top: 18px; border-top: 1px solid var(--sec-line); }

/* Dispositif de sécurité : l’information principale */
.sec-ev-security { padding: 18px 20px; border-radius: 14px; background: var(--sec-soft); border: 1px solid #f3c9d3; }
.sec-ev-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.sec-ev-tile { display: flex; flex-direction: column; gap: 3px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--sec-line); }
.sec-ev-tile span { color: var(--sec-muted); font-size: 12px; font-weight: 700; }
.sec-ev-tile strong { font-size: 15px; }
.sec-ev-tile small { color: var(--sec-muted); font-size: 12px; }
.sec-ev-tile.is-on { border-color: var(--sec-accent); box-shadow: inset 4px 0 0 var(--sec-accent); }
.sec-ev-tile.is-on strong { color: var(--sec-accent-dark); }
.sec-ev-shift { display: flex; gap: 12px; align-items: flex-start; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px dashed #e7a9b8; cursor: pointer; }
.sec-ev-shift input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--sec-accent); flex: none; }
.sec-ev-shift strong { display: block; font-size: 14px; }
.sec-ev-shift small { color: var(--sec-muted); font-size: 12px; }
.sec-ev-shift.is-readonly { cursor: default; opacity: .85; }

/* Ticket sécurité de l’événement */
.sec-ev-tickets { padding: 18px 20px; border-radius: 14px; border: 1px solid var(--sec-line); }
.sec-ev-linked-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 8px; }
.sec-ev-linked-edit input { width: 200px; padding: 9px 12px; border: 1px solid #d9b8c1; border-radius: 10px; font: inherit; font-weight: 700; }
.sec-ev-linked-edit small { color: var(--sec-muted); font-size: 12px; }
.sec-ev-ticket-item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; margin-top: 8px; padding: 10px 12px; border: 1px solid var(--sec-line); border-left: 4px solid var(--campus); border-radius: 10px; background: #fff; color: var(--sec-ink); text-decoration: none; }
.sec-ev-ticket-item:hover { background: var(--sec-soft); }
.sec-ev-ticket-no { padding: 4px 9px; border-radius: 8px; background: #2f1d22; color: #fff; font-size: 12px; font-weight: 800; white-space: nowrap; }
.sec-ev-ticket-title { min-width: 0; }
.sec-ev-ticket-title strong { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-ev-ticket-title small { color: var(--sec-muted); font-size: 12px; }
.sec-ev-prio { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; background: #f1f5f9; color: #475569; }
.sec-ev-prio.is-urgent { background: #b91c1c; color: #fff; }
.sec-ev-prio.is-high { background: #ffedd5; color: #9a3412; }
.sec-ev-prio.is-low { background: #ecfdf3; color: #166534; }
.sec-ev-empty { margin: 4px 0 0; color: var(--sec-muted); font-size: 13px; font-style: italic; }

.sec-ev-note { margin: 0; padding-left: 14px; border-left: 3px solid var(--campus); font-size: 15px; line-height: 1.6; max-width: 70ch; }
.sec-ev-dl { display: grid; grid-template-columns: max-content 1fr; gap: 7px 22px; margin: 0; font-size: 14px; }
.sec-ev-dl dt { color: var(--sec-muted); }
.sec-ev-dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

/* Contacts */
.sec-ev-person { padding: 16px; border: 1px solid var(--sec-line); border-radius: 14px; }
.sec-ev-person-head { display: flex; gap: 12px; align-items: center; }
.sec-ev-person-head strong { display: block; font-size: 16px; }
.sec-ev-person-head div span { display: block; color: var(--sec-muted); font-size: 13px; }
.sec-ev-avatar { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--campus); color: #fff; font-weight: 900; font-size: 15px; text-shadow: 0 1px 2px #0003; }
.sec-ev-person-lines { display: flex; flex-direction: column; gap: 2px; margin: 12px 0 0; font-size: 14px; overflow-wrap: anywhere; }
.sec-ev-person-lines a { color: var(--sec-accent); font-weight: 700; }
.sec-ev-person-actions { display: flex; gap: 8px; margin-top: 12px; }
.sec-ev-contact-btn { flex: 1; padding: 9px 12px; border: 1px solid #e7b5c2; border-radius: 10px; background: #fff; color: var(--sec-accent); font-size: 14px; font-weight: 800; text-align: center; text-decoration: none; }
.sec-ev-contact-btn:hover { background: var(--sec-soft); }

/* Validations */
.sec-ev-checks { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.sec-ev-checks li { display: flex; align-items: center; gap: 10px; }
.sec-ev-checks li > span:first-child { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; font-weight: 900; font-size: 12px; }
.sec-ev-checks .is-ok > span:first-child { background: #d8f5e5; color: #13703f; }
.sec-ev-checks .is-no { color: var(--sec-muted); }
.sec-ev-checks .is-no > span:first-child { background: #f3eef0; color: #9a8a90; }
.sec-ev-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sec-ev-trace { margin: 0; color: var(--sec-muted); font-size: 12px; }

/* Pied : actions */
.sec-ev-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: flex-end; padding: 14px 28px; border-top: 1px solid var(--sec-line); background: #fffafb; }
.sec-ev-status { flex: 1 1 320px; margin: 0; color: var(--sec-muted); font-size: 13px; }
.sec-ev-actions .btn { display: inline-flex; width: auto; height: auto; align-items: center; justify-content: center; padding: 10px 16px; border: 1px solid #e3c2cb; border-radius: 10px; background: #fff; color: var(--sec-accent-dark); font: inherit; font-size: 14px; font-weight: 800; cursor: pointer; }
.sec-ev-actions .btn:hover { background: var(--sec-soft); }
.sec-ev-actions .btn.primary { border-color: var(--sec-accent); background: var(--sec-accent); color: #fff; }
.sec-ev-actions .btn.primary:hover { background: var(--sec-accent-dark); }
.sec-ev-actions .btn[hidden] { display: none; }
.sec-ev-actions .btn:disabled { opacity: .6; cursor: wait; }

@media (max-width: 960px) {
  .sec-ev-grid { grid-template-columns: 1fr; }
  .sec-ev-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sec-ev-facts { grid-template-columns: 1fr; }
  .sec-ev-fact + .sec-ev-fact { border-left: 0; border-top: 1px solid var(--sec-line); }
}
@media (max-width: 620px) {
  .sec-ev-dialog { width: 100vw; max-width: 100vw; max-height: 100vh; height: 100vh; border-radius: 0; }
  .sec-ev-hero { grid-template-columns: 1fr auto; }
  .sec-ev-stub { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; min-width: 0; padding: 10px 18px; text-align: left; }
  .sec-ev-stub-day { font-size: 28px; margin: 0; }
  .sec-ev-hero-text { padding: 18px; }
  .sec-ev-body { padding: 16px 18px 20px; }
  .sec-ev-tiles { grid-template-columns: 1fr; }
  .sec-ev-actions { padding: 12px 18px; }
  .sec-ev-status { flex-basis: 100%; }
  .sec-ev-actions .btn { flex: 1 1 40%; padding: 9px 10px; font-size: 13px; }
  .sec-ev-actions .btn.primary { flex-basis: 100%; }
}

/* Thème sombre (bouton « ☾ Thème sombre ») : écrit à la main, la fiche n’est pas dans le générateur. */
html[data-theme="dark"] .sec-ev-dialog { --sec-soft: #2a171d; --sec-ink: #f4e8eb; --sec-muted: #c9b3ba; --sec-line: #4a2f37; background: #1d1316; box-shadow: 0 34px 90px #000a; }
html[data-theme="dark"] .sec-ev-dialog.sec-ev-dialog .sec-ev-hero-text h3 { color: #fff; }
html[data-theme="dark"] .sec-ev-badge:not(.is-guard):not(.is-public):not(.is-shift):not(.is-ok):not(.is-info):not(.is-warn):not(.is-danger), html[data-theme="dark"] .sec-ev-close, html[data-theme="dark"] .sec-ev-tile,
html[data-theme="dark"] .sec-ev-shift, html[data-theme="dark"] .sec-ev-ticket-item, html[data-theme="dark"] .sec-ev-contact-btn,
html[data-theme="dark"] .sec-ev-actions .btn:not(.primary), html[data-theme="dark"] .sec-ev-linked-edit input { background: #261a1e; color: var(--sec-ink); }
html[data-theme="dark"] .sec-ev-security { background: #2a171d; border-color: #5c2a38; }
html[data-theme="dark"] .sec-ev-actions { background: #21151a; }
html[data-theme="dark"] .sec-ev-tile.is-on strong, html[data-theme="dark"] .sec-ev-person-lines a, html[data-theme="dark"] .sec-ev-contact-btn { color: #ff9fb5; }
html[data-theme="dark"] .sec-ev-ticket-no { background: #f4e8eb; color: #2a171d; }
html[data-theme="dark"] .sec-ev-badge.is-public { background: #3a2410; color: #fdba74; }
html[data-theme="dark"] .sec-ev-badge.is-shift { background: #12301f; color: #86efac; }

/* ── fiches-securite-v840 (ajouté en V8.4.0) ──
   Mêmes fiches pour les visites d’entreprise, la main courante et les tickets (js/modules/fiches-securite.js). */
.sec-ev-badge.is-ok { background: #ecfdf3; border-color: #86efac; color: #166534; }
.sec-ev-badge.is-info { background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; }
.sec-ev-badge.is-warn { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
.sec-ev-badge.is-danger { background: #b51131; border-color: #b51131; color: #fff; }
.sec-ev-facts.sec-fiche-facts-1 { grid-template-columns: 1fr; }
.sec-ev-facts.sec-fiche-facts-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sec-fiche-buttons { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.sec-ev-actions a.btn { text-decoration: none; }
.sec-ev-stub-day.sec-fiche-ticket-no { font-size: 40px; }
.sec-fiche-next { margin: 0; font-size: 15px; font-weight: 700; color: var(--sec-accent-dark); }
button.sec-ev-ticket-item.sec-fiche-link { width: 100%; font: inherit; text-align: left; cursor: pointer; }
html[data-theme="dark"] .sec-ev-badge.is-ok { background: #12301f; color: #86efac; }
html[data-theme="dark"] .sec-ev-badge.is-info { background: #13233d; color: #93c5fd; }
html[data-theme="dark"] .sec-ev-badge.is-warn { background: #3a2410; color: #fdba74; }
html[data-theme="dark"] .sec-fiche-next { color: #ff9fb5; }
@media (max-width: 620px) {
  .sec-fiche-buttons { width: 100%; }
  .sec-fiche-buttons .btn { flex: 1 1 40%; }
  .sec-fiche-buttons .btn.primary { flex-basis: 100%; }
}
/* Les règles de lisibilité de Sécurité recolorent les .btn : le texte des boutons principaux reste blanc. */
.sec-ev-dialog.sec-ev-dialog .sec-ev-actions .btn.primary { color: #fff !important; }
.sec-ev-dialog.sec-ev-dialog .sec-ev-actions .btn:not(.primary) { color: var(--sec-accent-dark) !important; }
html[data-theme="dark"] .sec-ev-dialog.sec-ev-dialog .sec-ev-actions .btn:not(.primary) { color: #ffd0da !important; }
html[data-theme="dark"] .sec-ev-dialog.sec-ev-dialog .sec-ev-actions .btn.primary { background: #b51131 !important; border-color: #b51131 !important; color: #fff !important; }

/* ── fiche-suivi-mc-v841 (ajouté en V8.4.1) ──
   Formulaire de main courante (« Suivi de l’événement », « Nouvel événement ») aux couleurs des fiches.
   #mcModal et, depuis V8.5.1, l’assistant « Prise de poste » (#pdpModal). La passation ne change pas.
   --campus est fixé par js/modules/fiches-securite.js selon le site choisi. */
:is(#mcModal, #pdpModal).mc-fiche { --campus: #9f1239; --sec-accent: #9f1239; --sec-accent-dark: #6b0d24; --sec-soft: #fff1f3; --sec-ink: #2f1d22; --sec-muted: #6b5a5f; --sec-line: #ead9de; background: #2b0a1499; backdrop-filter: blur(3px); }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog { width: min(1100px, calc(100vw - 32px)); max-width: none; padding: 0; border: 0; border-radius: 18px; overflow: hidden; background: #fff; box-shadow: 0 34px 90px #2b0a1466; }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head { position: relative; display: grid; grid-template-columns: auto 1fr auto; align-items: stretch; gap: 0; padding: 0; margin: 0; border: 0; border-bottom: 1px solid var(--sec-line); border-radius: 0; background: var(--sec-soft); box-shadow: none; isolation: auto; overflow: visible; }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head::before, :is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head::after { display: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub { display: flex; flex-direction: column; justify-content: center; min-width: 150px; padding: 18px 24px; background: var(--campus); color: #fff; text-align: center; text-shadow: 0 1px 2px #0003; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub span { font-size: 13px; font-weight: 700; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub span:first-child::first-letter { text-transform: uppercase; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub strong { font-size: 50px; font-weight: 900; line-height: 1; letter-spacing: -.03em; margin: 4px 0; }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head > div:not(.mc-fiche-stub) { align-self: center; padding: 20px 26px; min-width: 0; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-kind { display: block; margin: 0 0 4px; color: var(--sec-muted); font-size: 14px; font-weight: 700; }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head h3 { margin: 0; color: var(--sec-ink) !important; font-size: clamp(1.4rem, 2.2vw, 1.9rem) !important; line-height: 1.15; letter-spacing: -.01em; }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head p { margin: 6px 0 0; color: var(--sec-muted); font-size: 13px; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-badges { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
:is(#mcModal, #pdpModal).mc-fiche .mc-fiche-badges:empty { display: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-close { align-self: start; margin: 16px 16px 0 0; width: 40px; height: 40px; border: 1px solid var(--sec-line); border-radius: 50%; background: #fff; color: var(--sec-ink); font-size: 18px; }

:is(#mcModal, #pdpModal).mc-fiche .mc-form { padding: 22px 28px 0; }
:is(#mcModal, #pdpModal).mc-fiche .mc-grid { gap: 16px 18px; }
:is(#mcModal, #pdpModal).mc-fiche .mc-field label { color: var(--sec-muted) !important; font-size: 12px; font-weight: 700; letter-spacing: 0; text-transform: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-field input, :is(#mcModal, #pdpModal).mc-fiche .mc-field select, :is(#mcModal, #pdpModal).mc-fiche .mc-field textarea { border: 1px solid #e3c9d0; border-radius: 10px; background: #fff; color: var(--sec-ink); font-size: 15px; box-shadow: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-field input:focus, :is(#mcModal, #pdpModal).mc-fiche .mc-field select:focus, :is(#mcModal, #pdpModal).mc-fiche .mc-field textarea:focus { border-color: var(--sec-accent); outline: 3px solid #9f12392e; outline-offset: 0; }
/* Mode suivi : les champs à mettre à jour (statut, compte rendu) restent signalés, en vert discret. */
:is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode #mcStatus, :is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode #mcDescription { border: 2px solid #69b77b !important; background: #f3fcf6 !important; box-shadow: none !important; }
:is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode .mc-field:has(#mcStatus) label, :is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode .mc-field:has(#mcDescription) label { color: #13703f !important; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot { position: sticky; bottom: 0; margin: 22px -28px 0; padding: 14px 28px; border-top: 1px solid var(--sec-line); background: #fffafb; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn { display: inline-flex; width: auto; height: auto; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border: 1px solid #e3c2cb; border-radius: 10px; background: #fff; color: var(--sec-accent-dark) !important; font-size: 14px; font-weight: 800; box-shadow: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn:hover { background: var(--sec-soft); }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn[type="submit"], :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn.btn-primary { border-color: var(--sec-accent); background: var(--sec-accent); color: #fff !important; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn[type="submit"]:hover, :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn.btn-primary:hover { background: var(--sec-accent-dark); }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn.mc-danger:not([hidden]), :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .mc-modal-delete:not([hidden]) { border-color: #f3a5a5; background: #fff5f5; color: #b91c1c !important; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn[hidden] { display: none; }
:is(#mcModal, #pdpModal).mc-fiche .mc-field .btn { border-radius: 10px; }

@media (max-width: 760px) {
  :is(#mcModal, #pdpModal).mc-fiche { padding: 0; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-dialog { width: 100vw; min-height: 100vh; border-radius: 0; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head { grid-template-columns: 1fr auto; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; min-width: 0; padding: 10px 18px; text-align: left; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub strong { font-size: 28px; margin: 0; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-form { padding: 16px 18px 0; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot { margin: 18px -18px 0; padding: 12px 18px; }
}

html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche { --sec-soft: #2a171d; --sec-ink: #f4e8eb; --sec-muted: #c9b3ba; --sec-line: #4a2f37; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-dialog { background: #1d1316 !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head { background: #2a171d !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head h3 { color: #fff !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-field input, html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-field select, html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-field textarea, html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-close { border-color: #5a3a43 !important; background: #261a1e !important; color: var(--sec-ink) !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode #mcStatus, html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche.mc-follow-mode #mcDescription { background: #12301f !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot { background: #21151a !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn:not([type="submit"]):not(.btn-primary) { background: #261a1e !important; color: #ffd0da !important; }
html[data-theme="dark"] :is(#mcModal, #pdpModal).mc-fiche .mc-form-foot .btn[type="submit"] { background: #b51131 !important; color: #fff !important; }

/* ── fenetres-saisie-v842 (ajouté en V8.4.2) ──
   Habillage commun des fenêtres de saisie (rondes, prise de poste, passation, objets trouvés, logés, pilotage,
   modification d’intervention…). Les classes sel-form-* sont posées par js/modules/fiches-securite.js.
   --sel-pad-* : marge intérieure du panneau, compensée pour que l’en-tête aille jusqu’aux bords. */
.sel-form-panel { --campus: #9f1239; --sec-accent: #9f1239; --sec-accent-dark: #6b0d24; --sec-soft: #fff1f3; --sec-ink: #2f1d22; --sec-muted: #6b5a5f; --sec-line: #ead9de; border-radius: 18px !important; border: 0 !important; box-shadow: 0 34px 90px #2b0a1466 !important; }
.sel-form-panel > .sel-form-head { position: relative !important; display: grid !important; grid-template-columns: 1fr auto; align-items: stretch !important; gap: 0 !important; margin: calc(-1 * var(--sel-pad-top, 0px)) calc(-1 * var(--sel-pad-right, 0px)) 20px calc(-1 * var(--sel-pad-left, 0px)) !important; padding: 0 !important; border: 0 !important; border-bottom: 1px solid var(--sec-line) !important; border-radius: 18px 18px 0 0 !important; background: var(--sec-soft) !important; background-image: none !important; box-shadow: none !important; color: var(--sec-ink) !important; overflow: hidden !important; isolation: auto !important; min-height: 0 !important; }
.sel-form-panel > .sel-form-head.has-stub { grid-template-columns: auto 1fr auto; }
.sel-form-panel > .sel-form-head::before, .sel-form-panel > .sel-form-head::after { display: none !important; content: none !important; }
.sel-form-panel .sel-form-stub { display: flex; flex-direction: column; justify-content: center; min-width: 140px; padding: 16px 22px; background: var(--campus); color: #fff; text-align: center; text-shadow: 0 1px 2px #0003; }
.sel-form-panel .sel-form-stub span { font-size: 13px; font-weight: 700; }
.sel-form-panel .sel-form-stub span:first-child::first-letter { text-transform: uppercase; }
.sel-form-panel .sel-form-stub strong { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.03em; margin: 3px 0; }
.sel-form-panel .sel-form-headtext { align-self: center; min-width: 0; padding: 20px 26px !important; }
html .sel-form-panel.sel-form-panel > .sel-form-head.sel-form-head h2, html .sel-form-panel.sel-form-panel > .sel-form-head.sel-form-head h3, html .sel-form-panel.sel-form-panel > .sel-form-head .sel-form-headtext h2, html .sel-form-panel.sel-form-panel > .sel-form-head .sel-form-headtext h3 { margin: 0 !important; color: var(--sec-ink) !important; font-size: clamp(1.3rem, 2vw, 1.75rem) !important; line-height: 1.15 !important; letter-spacing: -.01em; text-shadow: none !important; }
.sel-form-panel .sel-form-head p { margin: 6px 0 0 !important; color: var(--sec-muted) !important; font-size: 13px !important; }
.sel-form-panel .sel-form-close { align-self: start !important; margin: 16px 16px 0 0 !important; width: 40px !important; height: 40px !important; padding: 0 !important; border: 1px solid var(--sec-line) !important; border-radius: 50% !important; background: #fff !important; color: var(--sec-ink) !important; font-size: 18px !important; line-height: 1 !important; box-shadow: none !important; }
/* Champs */
.sel-form-panel label { color: var(--sec-muted) !important; font-size: 12px !important; font-weight: 700 !important; letter-spacing: 0 !important; text-transform: none !important; }
.sel-form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), .sel-form-panel select, .sel-form-panel textarea { border: 1px solid #e3c9d0 !important; border-radius: 10px !important; background-color: #fff !important; color: var(--sec-ink) !important; font-size: 15px !important; font-weight: 500 !important; box-shadow: none !important; }
.sel-form-panel input:focus, .sel-form-panel select:focus, .sel-form-panel textarea:focus { border-color: var(--sec-accent) !important; outline: 3px solid #9f12392e !important; outline-offset: 0 !important; }
.sel-form-panel input[type="checkbox"], .sel-form-panel input[type="radio"] { accent-color: var(--sec-accent); }
/* Boutons (hors en-tête) */
.sel-form-panel .btn:not(.sel-form-close) { display: inline-flex; width: auto; height: auto; align-items: center; justify-content: center; gap: 6px; padding: 10px 16px; border: 1px solid #e3c2cb !important; border-radius: 10px !important; background: #fff !important; color: var(--sec-accent-dark) !important; font-size: 14px; font-weight: 800; box-shadow: none !important; }
.sel-form-panel .btn:not(.sel-form-close):hover { background: var(--sec-soft) !important; }
.sel-form-panel .btn.btn-primary, .sel-form-panel button.btn[type="submit"] { border-color: var(--sec-accent) !important; background: var(--sec-accent) !important; color: #fff !important; }
.sel-form-panel .btn.btn-primary:hover, .sel-form-panel button.btn[type="submit"]:hover { background: var(--sec-accent-dark) !important; }
.sel-form-panel .btn.mc-danger:not([hidden]), .sel-form-panel .btn.danger:not([hidden]), .sel-form-panel .mc-modal-delete:not([hidden]) { border-color: #f3a5a5 !important; background: #fff5f5 !important; color: #b91c1c !important; }
.sel-form-panel [hidden] { display: none !important; }

@media (max-width: 620px) {
  .sel-form-panel > .sel-form-head.has-stub { grid-template-columns: 1fr auto; }
  .sel-form-panel .sel-form-stub { grid-column: 1 / -1; grid-row: 2; flex-direction: row; align-items: baseline; justify-content: flex-start; gap: 10px; min-width: 0; padding: 9px 18px; text-align: left; }
  .sel-form-panel .sel-form-stub strong { font-size: 26px; margin: 0; }
  .sel-form-panel .sel-form-headtext { padding: 16px 18px !important; }
}

html[data-theme="dark"] .sel-form-panel { --sec-soft: #2a171d; --sec-ink: #f4e8eb; --sec-muted: #c9b3ba; --sec-line: #4a2f37; }
html[data-theme="dark"] .sel-form-panel > .sel-form-head { background: #2a171d !important; }
html[data-theme="dark"] .sel-form-panel input:not([type="checkbox"]):not([type="radio"]):not([type="file"]), html[data-theme="dark"] .sel-form-panel select, html[data-theme="dark"] .sel-form-panel textarea, html[data-theme="dark"] .sel-form-panel .sel-form-close { border-color: #5a3a43 !important; background-color: #261a1e !important; color: var(--sec-ink) !important; }
html[data-theme="dark"] .sel-form-panel .btn:not(.sel-form-close):not(.btn-primary):not([type="submit"]) { background: #261a1e !important; color: #ffd0da !important; }
html[data-theme="dark"] .sel-form-panel .btn.btn-primary, html[data-theme="dark"] .sel-form-panel button.btn[type="submit"] { background: #b51131 !important; color: #fff !important; }
.sel-form-panel .sel-form-closetext { align-self: start !important; margin: 18px 18px 0 0 !important; padding: 8px 14px !important; border: 1px solid var(--sec-line) !important; border-radius: 999px !important; background: #fff !important; color: var(--sec-ink) !important; font-size: 13px !important; font-weight: 700 !important; white-space: nowrap; box-shadow: none !important; }
html[data-theme="dark"] .sel-form-panel .sel-form-closetext { background: #261a1e !important; color: var(--sec-ink) !important; }

/* ── fiche-prise-de-poste-v851 (ajouté en V8.5.1) ──
   Assistant « Prise de poste » (#pdpModal, js/modules/fiches-securite.js) : étapes, consignes du poste précédent,
   contrôles et récapitulatif au style des fiches. L’en-tête et le pied reprennent le bloc fiche-suivi-mc-v841. */
#pdpModal.mc-fiche .mc-dialog { width: min(1040px, calc(100vw - 32px)); }
#pdpModal .shift-wizard-progress { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 4px; }
#pdpModal .shift-wizard-step { display: flex; align-items: center; gap: 10px; min-height: 0; padding: 10px 14px; border: 1px solid var(--sec-line); border-radius: 12px; background: #fff; color: var(--sec-muted); font-size: 14px; font-weight: 700; box-shadow: none; }
#pdpModal .shift-wizard-step i { display: inline-grid; place-items: center; flex: none; width: 26px; height: 26px; border-radius: 50%; background: #f4e7eb; color: var(--sec-muted); font-size: 13px; font-style: normal; font-weight: 800; }
#pdpModal .shift-wizard-step.active { border-color: var(--campus); background: var(--sec-soft); color: var(--sec-ink); box-shadow: inset 0 0 0 1px var(--campus); }
#pdpModal .shift-wizard-step.active i { background: var(--campus) !important; color: #fff !important; }
#pdpModal .shift-wizard-step.done { color: #13703f; }
#pdpModal .shift-wizard-step.done i { background: #16a34a; color: #fff; font-size: 0; }
#pdpModal .shift-wizard-step.done i::after { content: "✓"; font-size: 14px; line-height: 1; }
#pdpModal .shift-wizard-panel, #pdpModal .shift-wizard-panel.active { padding: 0 !important; border: 0 !important; background: none !important; box-shadow: none !important; }

#pdpModal .mc-handover-modal { padding: 16px 18px; border: 1px solid var(--sec-line); border-left: 4px solid var(--campus); border-radius: 12px; background: var(--sec-soft); box-shadow: none; }
#pdpModal .mc-handover-modal > strong { display: block; margin: 0 0 6px; color: var(--sec-muted); font-size: 13px; font-weight: 800; letter-spacing: 0; text-transform: none; }
#pdpModal .mc-handover-modal > p { margin: 0 0 12px; color: var(--sec-ink); font-size: 15px; line-height: 1.5; white-space: pre-line; }
#pdpModal .mc-handover-modal > label,
#pdpModal .mc-checks label { display: flex !important; align-items: center; justify-content: flex-start; gap: 10px; width: auto; margin: 0; padding: 10px 12px; border: 1px solid #e3c9d0; border-radius: 10px; background: #fff; color: var(--sec-ink) !important; font-size: 14px !important; font-weight: 700; line-height: 1.3; text-align: left; cursor: pointer; }
#pdpModal .mc-handover-modal > label { width: fit-content; max-width: 100%; }
#pdpModal .mc-handover-modal input[type="checkbox"],
#pdpModal .mc-checks input[type="checkbox"] { flex: none; width: 18px; height: 18px; margin: 0; accent-color: #16a34a; }
#pdpModal .mc-handover-modal > label:has(input:checked),
#pdpModal .mc-checks label:has(input:checked) { border-color: #69b77b; background: #f3fcf6; color: #13703f !important; }
#pdpModal .mc-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
#pdpModal [class*="shift-planned-interventions"] { border: 1px solid var(--sec-line); border-radius: 12px; background: #fff; box-shadow: none; }
#pdpModal [class*="shift-planned-interventions"] h4 { color: var(--sec-ink) !important; }

#pdpModal .shift-review { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; border: 1px solid var(--sec-line); border-radius: 12px; overflow: hidden; background: #fff; }
#pdpModal .shift-review > b, #pdpModal .shift-review > span { padding: 12px 16px; border-bottom: 1px solid var(--sec-line); }
#pdpModal .shift-review > b { background: #fffafb; color: var(--sec-muted); font-size: 13px; font-weight: 700; letter-spacing: 0; text-transform: none; }
#pdpModal .shift-review > span { color: var(--sec-ink); font-size: 15px; }
#pdpModal .shift-review > :nth-last-child(-n+2) { border-bottom: 0; }
#pdpModal .shift-review-note { margin: 10px 0 0; color: var(--sec-muted); font-size: 13px; }

#pdpModal .mc-form-foot > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
#pdpModal .mc-form-foot [data-wizard-back][style*="hidden"] { display: none !important; }
#pdpModal .mc-form-foot .shift-wizard-nav { display: contents; }

@media (max-width: 760px) {
  #pdpModal .shift-wizard-progress { display: flex !important; flex-direction: row !important; gap: 8px; }
  #pdpModal .shift-wizard-step { flex: 0 0 auto; width: auto !important; }
  #pdpModal .shift-wizard-step.active { flex: 1 1 auto; }
  #pdpModal .shift-wizard-step:not(.active) { font-size: 0 !important; gap: 0; padding: 8px; }
  #pdpModal .shift-review { grid-template-columns: 1fr; }
  #pdpModal .shift-review > b { border-bottom: 0; padding-bottom: 2px; }
}
html[data-theme="dark"] #pdpModal .shift-wizard-step, html[data-theme="dark"] #pdpModal .mc-handover-modal > label, html[data-theme="dark"] #pdpModal .mc-checks label, html[data-theme="dark"] #pdpModal .shift-review, html[data-theme="dark"] #pdpModal [class*="shift-planned-interventions"] { border-color: #4a2f37 !important; background: #261a1e !important; color: var(--sec-ink) !important; }
html[data-theme="dark"] #pdpModal .shift-wizard-step.active, html[data-theme="dark"] #pdpModal .mc-handover-modal { background: #2a171d !important; }
html[data-theme="dark"] #pdpModal .shift-review > b { background: #21151a; }
html[data-theme="dark"] #pdpModal .mc-handover-modal > label:has(input:checked), html[data-theme="dark"] #pdpModal .mc-checks label:has(input:checked) { border-color: #2f7a48 !important; background: #12301f !important; color: #a7f3c4 !important; }

/* Fiche sans bouton (poste terminé) : pas de pied vide. */
#secFicheDialog .sec-ev-actions:has(#secFicheButtons:empty):has(#secFicheStatus:empty) { display: none; }

/* V8.6.9 — Fenêtre de la main courante (et de la prise de poste) : quand elle dépasse la hauteur de l'écran
   (zoom Ctrl + molette, petit écran), seul le milieu défile ; l'en-tête reste en haut et les boutons restent visibles en bas.
   Avant, le contenu était coupé (fenêtre limitée à la hauteur de l'écran, sans défilement) : le compte rendu disparaissait. */
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog { display: flex; flex-direction: column; max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); }
:is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head { flex: 0 0 auto; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
:is(#mcModal, #pdpModal).mc-fiche .mc-form-foot { z-index: 2; }
@media (max-height: 560px) {
  :is(#mcModal, #pdpModal).mc-fiche .mc-fiche-stub strong { font-size: 34px; }
  :is(#mcModal, #pdpModal).mc-fiche .mc-dialog-head p { display: none; }
}
