/* Utilitaires propres à l'outil DAT vers Confluence, préfixe dc-.
   Tout le reste vient de mm.css (design system Mon Makila).
   Les seules extensions sont :
   - le tableau de saisie (dc-edit), que le design system ne couvre pas : son
     DataTable est en lecture seule, nos sections sont des grilles éditables ;
   - le sommaire de la fiche et les grilles de la page, qui ne sont que de la
     mise en page.
   Aucune couleur en dur : tout passe par les jetons --mm-*. */

/* L'attribut hidden doit l'emporter sur les display du design system. */
[hidden] { display: none !important }

/* ── Mise en page ───────────────────────────────────────────────────────── */
.dc-stack { display: flex; flex-direction: column; gap: 14px; min-width: 0 }
.dc-stack--lg { gap: 18px }

.dc-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px }
.dc-grid .s2 { grid-column: span 2 }
.dc-grid .s3 { grid-column: span 3 }
@media (max-width: 1180px) {
  .dc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) }
  .dc-grid .s3 { grid-column: span 2 }
}
@media (max-width: 639.98px) {
  .dc-grid { grid-template-columns: minmax(0, 1fr) }
  .dc-grid .s2, .dc-grid .s3 { grid-column: span 1 }
}

.dc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px }
.dc-rule { height: 1px; background: var(--mm-border); margin: 4px 0 }

/* ── Section de la fiche ────────────────────────────────────────────────── */
.dc-sec { scroll-margin-top: calc(var(--mm-topbar-h) + 18px); animation: mmRise .3s var(--mm-ease-out) both }
.dc-sec__head { display: flex; align-items: center; gap: 10px }
.dc-sec__head > .mm-icon { font-size: 20px; color: var(--mm-ink-50); flex: 0 0 auto }
.dc-sec__head .mm-h-section { min-width: 0 }

/* ── Sélecteur, date et combo dessinés (7.6, 7.17) ──────────────────────── */
.dc-sel { justify-content: space-between; text-align: left; cursor: pointer }
.dc-sel__v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.dc-sel .mm-chevron { flex: 0 0 auto; font-size: 19px; color: var(--mm-ink-50) }
.dc-sel--ph .dc-sel__v { color: var(--mm-ink-44) }
/* Les menus dessinés sont posés sur document.body et placés en coordonnées
   fenêtre par dat-controls.js : à l'intérieur d'un tableau qui défile, un
   popover en absolu serait rogné. */
.dc-sel-menu, .dc-cal, .dc-row-menu { position: fixed }
.dc-sel-menu { overflow-y: auto }
.dc-pop { position: relative; min-width: 0 }
.dc-native { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 }

/* Calendrier (7.17) */
.dc-cal { width: min(320px, calc(100vw - 60px)); padding: 12px; border-radius: 16px; overflow-y: auto }
.dc-cal__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px }
.dc-cal__month { font-size: 13.5px; font-weight: 750 }
.dc-cal__wd, .dc-cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px }
.dc-cal__wd span { font-size: 10.5px; font-weight: 700; color: var(--mm-ink-50); text-align: center; padding-bottom: 4px }
.dc-cal__d { aspect-ratio: 1; min-height: 34px; border-radius: 9px; font-size: 12.5px; font-weight: 600; transition: background .16s ease, color .16s ease }
.dc-cal__d:hover { background: var(--mm-sunken) }
.dc-cal__d--out { opacity: .35 }
.dc-cal__d--today { color: var(--mm-red); font-weight: 750 }
.dc-cal__d--on, .dc-cal__d--on:hover { background: var(--mm-strong); color: var(--mm-on-strong); font-weight: 750 }
@media (pointer: coarse) { .dc-cal__d { min-height: 44px } }

/* ── Tableau de saisie ──────────────────────────────────────────────────── */
.dc-scroll { overflow: auto; max-height: min(62vh, 640px) }
.dc-edit { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px }
.dc-edit--fit { table-layout: fixed }
.dc-edit th {
  position: sticky; top: 0; z-index: 2; background: var(--mm-surface-2); height: 44px;
  padding: 0 8px; text-align: left; font-size: 12.5px; font-weight: 700; color: var(--mm-ink-72);
  border-bottom: 1px solid var(--mm-border); line-height: 1.2; overflow-wrap: break-word;
}
.dc-edit td { padding: 6px 4px; border-bottom: 1px solid var(--mm-line); vertical-align: middle }
.dc-edit tbody tr { transition: background .18s ease }
.dc-edit tbody tr:hover { background: var(--mm-surface-2) }
.dc-edit tbody tr:last-child td { border-bottom: 0 }
.dc-edit th:first-child, .dc-edit td:first-child { padding-left: 14px }
.dc-edit th:last-child, .dc-edit td:last-child { padding-right: 14px }
.dc-edit .mm-input, .dc-edit .dc-pop { width: 100% }
.dc-acts { display: flex; gap: 4px; justify-content: flex-end }
.dc-del:hover { background: var(--mm-soft-red); color: var(--mm-red-ink) }
.dc-ro { display: block; font-size: 13px; font-weight: 600; color: var(--mm-ink-80); padding: 0 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap }
.dc-add { align-self: flex-start }
.dc-empty-row td { color: var(--mm-ink-64); font-size: 13px; font-weight: 550; text-align: center; padding: 22px 12px }

/* ── Photos d'intervention ──────────────────────────────────────────────── */
.dc-photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 14px }
.dc-photo { padding: 10px; animation: mmRise .3s var(--mm-ease-out) both }
.dc-photo img { display: block; width: 100%; height: 146px; object-fit: cover; border-radius: 12px; background: var(--mm-sunken) }
.dc-photo__none {
  display: flex; align-items: center; justify-content: center; height: 146px; border-radius: 12px;
  background: var(--mm-sunken); color: var(--mm-ink-64); font-size: 12.5px; font-weight: 550;
  text-align: center; padding: 10px;
}
.dc-trunc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap }

/* ── Coque ──────────────────────────────────────────────────────────────── */
.dc-burger { display: none }
@media (max-width: 999.98px) {
  .mm-sidebar { display: none }
  .dc-burger { display: inline-flex }
}

/* ── Parcours de connexion (7.53) ───────────────────────────────────────── */
/* Le design system laisse le composant AuthLayout choisir entre le panneau noir
   et le bandeau compact ; sans React, la bascule se fait ici, à la rupture de
   navigation du design system (1000 px). */
.dc-auth-banner { display: none }
@media (max-width: 999.98px) {
  .mm-auth__brand { display: none }
  .dc-auth-banner { display: block }
}
.mm-auth__col > * + * { margin-top: 18px }
.mm-auth__col form > * + * { margin-top: 16px }
