/* ==========================================================================
   UI COMPONENTS - Zeller Ticket Manager
   ==========================================================================
   Purpose:  Bibliothèque de composants partagée par tous les écrans refondus :
             en-tête de page, sections, badges de statut, listes de propriétés,
             bloc de délai, fil d'activité, zone de saisie, pièces jointes.
   Actions:  Déclare des classes préfixées zt- qui n'utilisent que les tokens de
             tokens.css : aucune couleur, taille ou rayon n'est écrit en dur ici.
   Logic:    Un écran refondu s'enveloppe dans .zt-page, qui fixe la densité
             (14px) ; les écrans non migrés ne sont donc pas affectés. Les boutons
             restent ceux de Bootstrap, déjà alignés sur la marque par tokens.css.
             Le catalogue visuel de ces composants est la page admin
             « Design system » (/admin/design-system).
   Position: Étape 2 de la refonte du design. Chargé globalement après tokens.css,
             dans base.html.twig et customer/base.html.twig.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page
   -------------------------------------------------------------------------- */
.zt-page {
  font-family: var(--zt-font-sans);
  font-size: var(--zt-text-md);
  color: var(--zt-text);
  line-height: 1.5;
}

.zt-page h1,
.zt-page h2,
.zt-page h3 {
  color: var(--zt-text);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Densité globale : police, icônes, en-têtes hérités
   -------------------------------------------------------------------------- */
body,
main.container {
  font-family: var(--zt-font-sans);
  font-size: var(--zt-text-md);
  color: var(--zt-text);
}

/* --------------------------------------------------------------------------
   Coquille : le pied reste en bas si le contenu est plus court que l'écran
   --------------------------------------------------------------------------
   Purpose:  Éviter que .customer-footer / .footer-branding remontent au
             milieu des pages courtes (profil, formulaires, catalogue).
   Actions:  Colonne flex sur body ; main occupe l'espace restant.
   Logic:    Les pages autonomes (.zt-center-screen) restent hors de cette
             règle. L'interne avait le même flex via l'ancien countdown.css.
   Position: Suite B13 ; chargé partout via ui.css.
   -------------------------------------------------------------------------- */
body:not(.zt-center-screen) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body:not(.zt-center-screen) > main {
  flex: 1 0 auto;
}

body:not(.zt-center-screen) > .customer-footer,
body:not(.zt-center-screen) > .footer-branding {
  flex-shrink: 0;
  margin-top: auto;
}

/* --------------------------------------------------------------------------
   Pied interne — remplace branding.css (.footer-branding / .footer-logo)
   --------------------------------------------------------------------------
   Purpose:  Bandeau Zeller en bas des pages internes, tokens uniquement.
   Actions:  Le markup de base.html.twig (logo + copyright) reste identique.
   Logic:    Même densité que .customer-footer ; pas d’ombre ni d’animation.
   Position: Étape C2.
   -------------------------------------------------------------------------- */
.footer-branding {
  padding: var(--zt-space-4) 0;
  border-top: 1px solid var(--zt-border);
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
}

.footer-logo {
  max-height: 1.875rem;
  width: auto;
  opacity: 0.7;
}

.bi {
  font-size: 1em;
  line-height: 1;
  vertical-align: -0.08em;
}

.app-hero-title,
.page-title,
.app-hero-title i,
.page-title i {
  font-size: var(--zt-text-xl) !important;
  font-weight: var(--zt-weight-semibold);
}

.app-hero-title i,
.page-title i {
  font-size: 1.1em !important;
}

.app-hero-subtitle,
.page-subtitle {
  font-size: var(--zt-text-sm) !important;
  color: var(--zt-text-secondary);
}

.app-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: 0.375rem 0.75rem;
  border: 0;
  border-radius: var(--zt-radius-md);
  background: var(--zt-primary);
  color: var(--zt-gray-0);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
  text-decoration: none;
}

.app-btn-primary:hover {
  background: var(--zt-primary-hover);
  color: var(--zt-gray-0);
}

.app-btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--zt-border-strong);
  border-radius: var(--zt-radius-md);
  background: transparent;
  color: var(--zt-text);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
  text-decoration: none;
}

.app-btn-secondary:hover {
  background: var(--zt-bg-hover);
  color: var(--zt-text);
}

.zt-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2);
  margin: 0 0 var(--zt-space-2);
  padding: 0;
  list-style: none;
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.zt-breadcrumb a {
  color: var(--zt-text-secondary);
  text-decoration: none;
}

.zt-breadcrumb a:hover {
  color: var(--zt-primary-text);
}

.zt-breadcrumb li + li::before {
  content: "/";
  margin-right: var(--zt-space-2);
  color: var(--zt-text-muted);
}

/* --------------------------------------------------------------------------
   En-tête de page
   -------------------------------------------------------------------------- */
.zt-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--zt-space-4);
  padding-bottom: var(--zt-space-5);
  margin-bottom: var(--zt-space-5);
  border-bottom: 1px solid var(--zt-border);
}

.zt-page-header__main {
  min-width: 0;
  flex: 1 1 420px;
}

.zt-page-header__title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-3);
  margin: 0;
  font-size: var(--zt-text-xl);
  font-weight: var(--zt-weight-semibold);
  line-height: 1.3;
}

.zt-page-header__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2) var(--zt-space-4);
  margin-top: var(--zt-space-2);
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.zt-page-header__meta a {
  color: inherit;
  text-decoration: none;
}

.zt-page-header__meta a:hover {
  color: var(--zt-primary-text);
}

.zt-page-header__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2);
}

.zt-page-header__actions form {
  margin: 0;
}

.zt-id {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem var(--zt-space-2);
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-family: var(--zt-font-mono);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
}

/* --------------------------------------------------------------------------
   Badge de statut : pastille de couleur + libellé neutre
   -------------------------------------------------------------------------- */
.zt-status {
  --zt-status-color: var(--zt-gray-400);
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-pill);
  background: var(--zt-bg-surface);
  color: var(--zt-text);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  line-height: 1.5;
  white-space: nowrap;
}

.zt-status::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-status-color);
}

.zt-status--new,
.zt-status--pending_assignment { --zt-status-color: var(--zt-info); }
.zt-status--in_progress { --zt-status-color: var(--zt-warning); }
.zt-status--reopened { --zt-status-color: var(--zt-warning-strong); }
.zt-status--paused,
.zt-status--on_hold { --zt-status-color: var(--zt-gray-400); }
.zt-status--resolved { --zt-status-color: var(--zt-success); }
.zt-status--completed { --zt-status-color: var(--zt-success-strong); }
.zt-status--available { --zt-status-color: var(--zt-info); }
.zt-status--cleaning { --zt-status-color: var(--zt-warning); }
.zt-status--cleaned { --zt-status-color: var(--zt-warning-strong); }
.zt-status--testing { --zt-status-color: var(--zt-info-strong); }
.zt-status--done { --zt-status-color: var(--zt-success); }
.zt-status--planned,
.zt-status--active { --zt-status-color: var(--zt-success); }
.zt-status--cancelled,
.zt-status--inactive { --zt-status-color: var(--zt-danger); }

/* Anciens badges de statut : même rendu que .zt-status */
.status-badge {
  --zt-status-color: var(--zt-gray-400);
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-1);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
  color: var(--zt-text);
}
.status-badge::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-status-color);
}
.status-badge.status-new,
.status-new { --zt-status-color: var(--zt-info); }
.status-badge.status-in_progress,
.status-in_progress,
.status-in-progress { --zt-status-color: var(--zt-warning); }
.status-badge.status-reopened { --zt-status-color: var(--zt-warning-strong); }
.status-badge.status-paused,
.status-badge.status-on_hold { --zt-status-color: var(--zt-gray-400); }
.status-badge.status-resolved,
.status-badge.status-active,
.status-badge.status-planned { --zt-status-color: var(--zt-success); }
.status-badge.status-completed { --zt-status-color: var(--zt-success-strong); }
.status-badge.status-closed { --zt-status-color: var(--zt-gray-600); }
.status-badge.status-cancelled,
.status-badge.status-inactive { --zt-status-color: var(--zt-danger); }

/* Étiquette neutre (type, lieu, code) */
.zt-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-1);
  padding: 0.0625rem var(--zt-space-2);
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
}

/* --------------------------------------------------------------------------
   Mise en page détail : contenu + colonne de propriétés
   -------------------------------------------------------------------------- */
.zt-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--zt-space-6);
  align-items: start;
}

.zt-detail__main,
.zt-detail__aside {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-5);
  min-width: 0;
}

@media (max-width: 991.98px) {
  .zt-detail {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Section : conteneur à bordure fine, sans ombre
   -------------------------------------------------------------------------- */
.zt-section {
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
}

.zt-section__header {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: var(--zt-space-3) var(--zt-space-4);
  border-bottom: 1px solid var(--zt-border);
}

.zt-section__title {
  margin: 0;
  font-size: var(--zt-text-md);
  font-weight: var(--zt-weight-semibold);
}

.zt-section__body {
  padding: var(--zt-space-4);
}

.zt-section__body > :last-child {
  margin-bottom: 0;
}

/* Solution : même section que Description / Activity, accent success discret */
.zt-solution {
  --zt-section-accent: var(--zt-success);
}

.zt-solution .zt-section__header {
  background: var(--zt-success-soft);
}

.zt-solution .zt-section__title {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
  color: var(--zt-success-strong);
}

.zt-solution--compact .zt-section__header,
.zt-solution--compact .zt-section__body {
  padding: var(--zt-space-3) var(--zt-space-4);
  font-size: var(--zt-text-sm);
}

.zt-label {
  margin: 0 0 var(--zt-space-2);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.zt-prose {
  white-space: normal;
  overflow-wrap: anywhere;
}

.zt-muted {
  color: var(--zt-text-secondary);
}

/* --------------------------------------------------------------------------
   Encadré d'alerte
   -------------------------------------------------------------------------- */
.zt-callout {
  --zt-callout-color: var(--zt-info-strong);
  --zt-callout-bg: var(--zt-info-soft);
  display: flex;
  gap: var(--zt-space-3);
  padding: var(--zt-space-3) var(--zt-space-4);
  border: 1px solid var(--zt-border);
  border-left: 3px solid var(--zt-callout-color);
  border-radius: var(--zt-radius-md);
  background: var(--zt-callout-bg);
}

.zt-callout > i {
  color: var(--zt-callout-color);
  line-height: 1.5;
}

.zt-callout__title {
  margin: 0;
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-callout-color);
}

.zt-callout p {
  margin: var(--zt-space-1) 0 0;
}

.zt-callout--danger { --zt-callout-color: var(--zt-danger-strong); --zt-callout-bg: var(--zt-danger-soft); }
.zt-callout--warning { --zt-callout-color: var(--zt-warning-strong); --zt-callout-bg: var(--zt-warning-soft); }
.zt-callout--success { --zt-callout-color: var(--zt-success-strong); --zt-callout-bg: var(--zt-success-soft); }

/* --------------------------------------------------------------------------
   Liste de propriétés : libellé / valeur
   -------------------------------------------------------------------------- */
.zt-props {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--zt-space-3) var(--zt-space-3);
  margin: 0;
}

.zt-props dt {
  padding-top: 0.125rem;
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-regular);
  color: var(--zt-text-secondary);
}

.zt-props dd {
  min-width: 0;
  margin: 0;
  font-size: var(--zt-text-sm);
  overflow-wrap: anywhere;
}

.zt-props__sub {
  display: block;
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.zt-props-divider {
  height: 1px;
  margin: var(--zt-space-4) 0;
  background: var(--zt-border);
}

/* Bouton discret à côté d'une valeur (modifier, changer...) */
.zt-link-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-1);
  padding: 0;
  border: 0;
  background: none;
  color: var(--zt-primary-text);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  text-decoration: none;
  cursor: pointer;
}

.zt-link-btn:hover {
  color: var(--zt-primary-strong);
  text-decoration: underline;
}

/* Petit formulaire d'édition dépliable sous une valeur */
.zt-inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zt-space-2);
  margin-top: var(--zt-space-2);
}

.zt-inline-form .form-control,
.zt-inline-form .form-select {
  flex: 1 1 160px;
  font-size: var(--zt-text-sm);
}

/* --------------------------------------------------------------------------
   Personnes
   -------------------------------------------------------------------------- */
.zt-avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-primary-soft);
  color: var(--zt-primary-strong);
  font-size: 0.625rem;
  font-weight: var(--zt-weight-semibold);
  text-transform: uppercase;
}

.zt-avatar--lg {
  width: 2rem;
  height: 2rem;
  font-size: var(--zt-text-xs);
}

.zt-person {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
  min-width: 0;
}

.zt-people {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-2);
}

/* --------------------------------------------------------------------------
   Délais (SLA)
   -------------------------------------------------------------------------- */
.zt-sla {
  --zt-sla-color: var(--zt-primary-text);
  padding: var(--zt-space-3);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-surface);
}

.zt-sla + .zt-sla {
  margin-top: var(--zt-space-2);
}

.zt-sla__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--zt-space-2);
}

.zt-sla__label {
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
}

.zt-sla__due {
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
  white-space: nowrap;
}

.zt-sla__remaining {
  margin-top: var(--zt-space-1);
  font-size: var(--zt-text-lg);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-sla-color);
  font-variant-numeric: tabular-nums;
}

.zt-sla--expired {
  --zt-sla-color: var(--zt-danger-strong);
  border-color: var(--zt-danger);
  background: var(--zt-danger-soft);
}

/* --------------------------------------------------------------------------
   Compte à rebours des délais (hook JS [data-countdown])
   --------------------------------------------------------------------------
   Purpose:  Remplace countdown.css pour le seul sélecteur encore utilisé.
   Actions:  countdown.js pose .text-danger / .text-warning / .text-info.
   Logic:    Tokens uniquement ; plus de hex ni d'animation pulse.
   Position: Étape C2 ; chargé via ui.css (plus de countdown.css).
   -------------------------------------------------------------------------- */
.countdown-timer {
  display: inline-block;
  min-width: 6.25rem;
  padding: 0.125rem 0.375rem;
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-subtle);
  font-family: var(--zt-font-mono);
  text-align: center;
}

.countdown-timer.text-danger,
.countdown-timer.expired {
  background: var(--zt-danger-soft);
  color: var(--zt-danger-strong);
}

.countdown-timer.text-warning {
  background: var(--zt-warning-soft);
  color: var(--zt-warning-strong);
}

.countdown-timer.text-info {
  background: var(--zt-info-soft);
  color: var(--zt-info);
}

/* --------------------------------------------------------------------------
   Filtres segmentés
   -------------------------------------------------------------------------- */
.zt-filters {
  display: inline-flex;
  gap: 0.125rem;
  padding: 0.125rem;
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-subtle);
}

.zt-filter {
  padding: 0.125rem var(--zt-space-3);
  border: 0;
  border-radius: var(--zt-radius-sm);
  background: transparent;
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  cursor: pointer;
}

.zt-filter[aria-pressed="true"] {
  background: var(--zt-bg-surface);
  color: var(--zt-text);
  box-shadow: 0 0 0 1px var(--zt-border);
}

/* --------------------------------------------------------------------------
   Fil d'activité : commentaires et événements dans une seule chronologie
   -------------------------------------------------------------------------- */
.zt-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.zt-timeline::before {
  content: "";
  position: absolute;
  top: var(--zt-space-2);
  bottom: var(--zt-space-2);
  left: 0.6875rem;
  width: 1px;
  background: var(--zt-border);
}

.zt-tl-item {
  position: relative;
  display: flex;
  gap: var(--zt-space-3);
}

.zt-tl-item[hidden] {
  display: none;
}

.zt-tl-marker {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-bg-surface);
  box-shadow: 0 0 0 1px var(--zt-border);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-xs);
}

.zt-tl-item--event .zt-tl-body {
  padding-top: 0.125rem;
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.zt-tl-item--event .zt-tl-actor {
  color: var(--zt-text);
  font-weight: var(--zt-weight-medium);
}

.zt-tl-body {
  flex: 1;
  min-width: 0;
}

.zt-tl-time {
  margin-left: var(--zt-space-2);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-muted);
  white-space: nowrap;
}

.zt-comment {
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
  background: var(--zt-bg-surface);
}

.zt-comment__header {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: var(--zt-space-2) var(--zt-space-3);
  border-bottom: 1px solid var(--zt-border);
  font-size: var(--zt-text-sm);
}

.zt-comment__author {
  font-weight: var(--zt-weight-semibold);
}

.zt-comment__header form {
  margin: 0 0 0 auto;
}

.zt-comment__body {
  padding: var(--zt-space-3);
  overflow-wrap: anywhere;
}

.zt-comment__files {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zt-space-2);
  padding: 0 var(--zt-space-3) var(--zt-space-3);
}

.zt-thumb {
  display: block;
  width: 88px;
  text-decoration: none;
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-xs);
}

.zt-thumb img,
.zt-thumb__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 64px;
  object-fit: cover;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-subtle);
  font-size: 1.25rem;
}

.zt-thumb span {
  display: block;
  margin-top: var(--zt-space-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Zone de saisie d'un message
   -------------------------------------------------------------------------- */
.zt-composer {
  border: 1px solid var(--zt-border-strong);
  border-radius: var(--zt-radius-lg);
  background: var(--zt-bg-surface);
}

.zt-composer:focus-within {
  border-color: var(--zt-primary);
  box-shadow: 0 0 0 3px var(--zt-primary-focus);
}

.zt-composer textarea {
  display: block;
  width: 100%;
  min-height: 96px;
  padding: var(--zt-space-3);
  border: 0;
  border-radius: var(--zt-radius-lg) var(--zt-radius-lg) 0 0;
  background: transparent;
  font-size: var(--zt-text-md);
  resize: vertical;
}

.zt-composer textarea:focus {
  outline: none;
  box-shadow: none;
}

.zt-composer__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2) var(--zt-space-3);
  padding: var(--zt-space-2) var(--zt-space-3);
  border-top: 1px solid var(--zt-border);
  background: var(--zt-bg-subtle);
  border-radius: 0 0 var(--zt-radius-lg) var(--zt-radius-lg);
}

.zt-composer__footer .form-control,
.zt-composer__footer .form-select {
  width: auto;
  max-width: 100%;
  font-size: var(--zt-text-sm);
}

.zt-composer__hint {
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.zt-composer__submit {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Liste de fichiers
   -------------------------------------------------------------------------- */
.zt-files {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.zt-file {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  min-width: 0;
  font-size: var(--zt-text-sm);
}

.zt-file__ext {
  flex-shrink: 0;
  min-width: 2.5rem;
  padding: 0.0625rem var(--zt-space-1);
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-size: 0.625rem;
  font-weight: var(--zt-weight-semibold);
  text-align: center;
}

.zt-file__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--zt-text);
  text-decoration: none;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zt-file__name:hover {
  color: var(--zt-primary-text);
}

.zt-file__meta {
  flex-shrink: 0;
  font-size: var(--zt-text-xs);
  color: var(--zt-text-muted);
}

.zt-file form {
  margin: 0;
}

.zt-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: var(--zt-radius-sm);
  background: transparent;
  color: var(--zt-text-secondary);
  text-decoration: none;
}

.zt-icon-btn:hover {
  background: var(--zt-bg-subtle);
  color: var(--zt-text);
}

.zt-icon-btn--danger:hover {
  background: var(--zt-danger-soft);
  color: var(--zt-danger-strong);
}

/* --------------------------------------------------------------------------
   État vide
   -------------------------------------------------------------------------- */
.zt-empty {
  padding: var(--zt-space-6) var(--zt-space-4);
  text-align: center;
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.zt-empty > i {
  display: block;
  margin-bottom: var(--zt-space-2);
  font-size: 1.25rem;
  color: var(--zt-text-muted);
}

/* --------------------------------------------------------------------------
   Menu d'actions secondaires
   -------------------------------------------------------------------------- */
.zt-menu .dropdown-item {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  font-size: var(--zt-text-sm);
}

.zt-menu form {
  margin: 0;
}

.zt-menu .dropdown-item--danger {
  color: var(--zt-danger-strong);
}

.zt-menu .dropdown-item--danger:hover,
.zt-menu .dropdown-item--danger:focus {
  background: var(--zt-danger-soft);
  color: var(--zt-danger-strong);
}

/* --------------------------------------------------------------------------
   Pages autonomes centrées (accès refusé, erreurs)
   -------------------------------------------------------------------------- */
.zt-center-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: var(--zt-space-4);
  background: var(--zt-bg-page);
}

.zt-narrow {
  width: 100%;
  max-width: 480px;
}

.zt-hero-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: var(--zt-space-3);
  border-radius: var(--zt-radius-pill);
  background: var(--zt-primary-soft);
  color: var(--zt-primary-text);
  font-size: 1.5rem;
}

/* --------------------------------------------------------------------------
   Navbar interne — remplace modern-design.css (.modern-navbar)
   --------------------------------------------------------------------------
   Purpose:  Barre interne (marque, liens, menu utilisateur) en tokens, sans
             dégradé, ombre ni animation.
   Actions:  Classes historiques conservées pour le markup et les tests.
   Logic:    Tout est scopé sous .modern-navbar pour ne pas colorer le portail.
             --zt-nav-fg reste clair : le fond (--zt-nav-bg) est bleu-600 en
             aperçu clair et #0b0d11 en sombre.
   Position: Étape C2.
   -------------------------------------------------------------------------- */
.modern-navbar {
  background: var(--zt-nav-bg);
  border-bottom: 1px solid var(--zt-border);
  padding: var(--zt-space-3) 0;
}

.modern-navbar .navbar-brand {
  padding: 0;
  margin-right: var(--zt-space-4);
  color: var(--zt-nav-fg) !important;
}

.modern-navbar .navbar-brand:hover {
  color: var(--zt-nav-fg) !important;
}

.modern-navbar .brand-container {
  display: flex;
  align-items: center;
  gap: var(--zt-space-3);
}

.modern-navbar .brand-logo {
  height: 2.5rem;
  width: auto;
}

.modern-navbar .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.modern-navbar .brand-name {
  font-size: var(--zt-text-xl);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-nav-fg);
}

.modern-navbar .brand-subtitle {
  font-size: var(--zt-text-xs);
  color: var(--zt-nav-fg-muted);
}

.modern-navbar .navbar-nav .nav-link {
  color: var(--zt-nav-fg-muted);
  padding: var(--zt-space-3) var(--zt-space-4);
  border-radius: var(--zt-radius-sm);
  margin: 0 var(--zt-space-1);
}

.modern-navbar .navbar-nav .nav-link:hover,
.modern-navbar .navbar-nav .nav-link.active,
.modern-navbar .navbar-nav .nav-link.show {
  color: var(--zt-nav-fg);
  background: var(--zt-nav-hover);
}

.modern-navbar .nav-link-content,
.modern-navbar .user-menu-content {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
}

.modern-navbar .nav-icon {
  font-size: var(--zt-text-lg);
  width: 1.25rem;
  text-align: center;
}

.modern-navbar .nav-text {
  font-weight: var(--zt-weight-medium);
  font-size: var(--zt-text-md);
}

.modern-navbar .user-menu {
  padding: var(--zt-space-2) var(--zt-space-4);
}

.modern-navbar .user-avatar {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--zt-nav-hover);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zt-nav-fg);
  font-size: var(--zt-text-lg);
}

.modern-navbar .user-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.modern-navbar .user-name {
  font-size: var(--zt-text-md);
  font-weight: var(--zt-weight-medium);
  color: var(--zt-nav-fg);
}

.modern-navbar .user-role {
  font-size: var(--zt-text-xs);
  color: var(--zt-nav-fg-muted);
}

.modern-navbar .dropdown-toggle::after {
  display: none;
}

.modern-navbar .dropdown-arrow {
  font-size: var(--zt-text-xs);
  color: var(--zt-nav-fg-muted);
}

.modern-navbar .modern-dropdown {
  min-width: 17.5rem;
  padding: var(--zt-space-2);
  margin-top: var(--zt-space-2);
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
}

.modern-navbar .modern-dropdown .dropdown-header {
  padding: var(--zt-space-4);
  background: var(--zt-bg-subtle);
  border-radius: var(--zt-radius-sm);
  margin-bottom: var(--zt-space-2);
}

.modern-navbar .dropdown-user-info {
  display: flex;
  align-items: center;
  gap: var(--zt-space-3);
}

.modern-navbar .dropdown-user-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: var(--zt-primary-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--zt-primary-text);
  font-size: var(--zt-text-lg);
}

.modern-navbar .dropdown-user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.modern-navbar .dropdown-user-name {
  font-size: var(--zt-text-md);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text);
}

.modern-navbar .dropdown-user-email {
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.modern-navbar .modern-dropdown .dropdown-item {
  padding: var(--zt-space-3) var(--zt-space-4);
  border-radius: var(--zt-radius-sm);
  color: var(--zt-text);
}

.modern-navbar .modern-dropdown .dropdown-item:hover {
  background: var(--zt-bg-hover);
  color: var(--zt-text);
}

.modern-navbar .modern-dropdown .dropdown-divider {
  margin: var(--zt-space-2) 0;
  border-color: var(--zt-border);
}

.modern-navbar .login-link {
  background: var(--zt-nav-hover);
  border: 1px solid var(--zt-border);
}

.modern-navbar .navbar-toggler {
  border-color: var(--zt-border-strong);
}

.modern-navbar .navbar-toggler:focus {
  box-shadow: none;
}

.modern-navbar .navbar-toggler-icon {
  filter: invert(1);
}

@media (max-width: 991.98px) {
  .modern-navbar {
    padding: var(--zt-space-2) 0;
  }

  .modern-navbar .brand-container {
    gap: var(--zt-space-2);
  }

  .modern-navbar .brand-logo {
    height: 2rem;
  }

  .modern-navbar .brand-name {
    font-size: var(--zt-text-lg);
  }

  .modern-navbar .navbar-nav .nav-link {
    padding: var(--zt-space-3) var(--zt-space-4);
    margin: var(--zt-space-1) 0;
  }

  .modern-navbar .modern-dropdown {
    min-width: 100%;
    margin-top: var(--zt-space-1);
  }
}

/* --------------------------------------------------------------------------
   Reliquats de modern-design.css encore utilisés hors navbar
   --------------------------------------------------------------------------
   Purpose:  Garder lisibles les erreurs de formulaire et les blocs délai
             des modales ticket après le retrait de modern-design.css.
   Actions:  .error-message (issue/_form) ; .info-elegant (issue/_show_modals).
   Logic:    Tokens uniquement (plus de dark-bridge).
   Position: Étape C2.
   -------------------------------------------------------------------------- */
.error-message {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: var(--zt-space-2);
  margin-bottom: var(--zt-space-1);
  background: var(--zt-danger-soft);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-sm);
  color: var(--zt-danger-strong);
}

.error-message:last-child {
  margin-bottom: 0;
}

.info-elegant {
  display: flex;
  align-items: flex-start;
  gap: var(--zt-space-2);
  padding: var(--zt-space-3);
  margin-bottom: var(--zt-space-2);
  background: var(--zt-bg-subtle);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  color: var(--zt-text);
}

.info-elegant i {
  color: var(--zt-primary-text);
  flex-shrink: 0;
}

.info-label {
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
  margin-bottom: var(--zt-space-1);
}

.info-value {
  color: var(--zt-text);
  font-size: var(--zt-text-sm);
}

/* --------------------------------------------------------------------------
   Portail client — barre et pied (remplace le <style> de customer/base)
   --------------------------------------------------------------------------
   Purpose:  Navigation et footer du portail, tokens uniquement, sans dégradé.
   Actions:  Les classes .customer-nav / #customerNavbar restent pour Bootstrap.
   Logic:    data-portal="customer" fournit déjà --zt-primary rouge.
   Position: Étape B13.
   -------------------------------------------------------------------------- */
.customer-nav {
  background: var(--zt-nav-bg);
  border-bottom: 1px solid var(--zt-border);
}

.customer-nav .navbar-brand {
  color: var(--zt-text);
  font-weight: var(--zt-weight-semibold);
}

.customer-nav .navbar-brand:hover {
  color: var(--zt-primary-text);
}

.customer-nav .nav-link {
  color: var(--zt-text-secondary);
  border-radius: var(--zt-radius-sm);
}

.customer-nav .nav-link:hover,
.customer-nav .nav-link.active,
.customer-nav .nav-link.show {
  color: var(--zt-text);
  background: var(--zt-bg-hover);
}

.customer-nav .dropdown-menu {
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
}

.customer-nav .dropdown-item {
  color: var(--zt-text);
}

.customer-nav .dropdown-item:hover {
  background: var(--zt-bg-hover);
  color: var(--zt-text);
}

.customer-nav .navbar-toggler {
  border-color: var(--zt-border-strong);
}

.customer-nav .navbar-toggler-icon {
  filter: invert(1);
}

.customer-footer {
  padding: var(--zt-space-4) 0;
  border-top: 1px solid var(--zt-border);
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
}

/* --------------------------------------------------------------------------
   Connexion autonome — fond photo optionnel, tokens uniquement
   --------------------------------------------------------------------------
   Purpose:  Carte de login sans <style> ni dégradé hex.
   Actions:  --zt-auth-image (URL) pose la photo derrière un voile --zt-bg-page.
   Logic:    Pas d'ombre ni d'animation ; les ids #email / #password restent
             dans le template.
   Position: Étape B12 ; login.jpg est absent du dépôt (fond tokens seul).
   -------------------------------------------------------------------------- */
.zt-auth {
  position: relative;
  isolation: isolate;
}

.zt-auth::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-color: var(--zt-bg-page);
  background-image: var(--zt-auth-image, none);
  background-position: center;
  background-size: cover;
  opacity: 0.22;
  pointer-events: none;
}

.zt-auth-field {
  position: relative;
}

.zt-auth-field .form-control {
  padding-left: 2.25rem;
}

.zt-auth-field i {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  color: var(--zt-text-muted);
  pointer-events: none;
  transform: translateY(-50%);
}

/* --------------------------------------------------------------------------
   Catalogue (page Design system)
   -------------------------------------------------------------------------- */
.zt-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: var(--zt-space-2);
}

.zt-swatch {
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.zt-swatch__chip {
  height: 40px;
  margin-bottom: var(--zt-space-1);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
}

/* --------------------------------------------------------------------------
   Formulaires (création / édition) et pieds d'action
   -------------------------------------------------------------------------- */
.zt-form {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-6);
}

.zt-form__layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  gap: var(--zt-space-6);
}

@media (max-width: 767.98px) {
  .zt-form__layout {
    grid-template-columns: 1fr;
  }
}

.zt-field {
  margin-bottom: var(--zt-space-4);
}

.zt-field:last-child {
  margin-bottom: 0;
}

.zt-form .form-label,
.zt-modal .form-label {
  display: block;
  margin-bottom: var(--zt-space-1);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
  color: var(--zt-text);
}

.zt-form .form-control,
.zt-form .form-select,
.zt-modal .form-control,
.zt-modal .form-select {
  border: 1px solid var(--zt-border-strong);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-page);
  color: var(--zt-text);
  font-size: var(--zt-text-md);
}

.zt-form .form-text,
.zt-modal .form-text,
.form-help,
.form-help-multiple {
  margin-top: var(--zt-space-1);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

/* --------------------------------------------------------------------------
   Reliquats de forms.css encore posés par les FormTypes / form_end
   --------------------------------------------------------------------------
   Purpose:  Espacer les lignes Symfony (row_attr form-group) après le retrait
             de forms.css, sans recopier les overrides Bootstrap.
   Actions:  .form-group sur IssueType, ProjectType, UserType, etc.
   Logic:    Les écrans migrés utilisent déjà .zt-field ; ceci ne sert que
             si form_row / form_rest rend encore la ligne.
   Position: Étape C2.
   -------------------------------------------------------------------------- */
.form-group {
  margin-bottom: var(--zt-space-4);
}

.form-group:last-child {
  margin-bottom: 0;
}

.zt-form__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--zt-space-2);
  padding-top: var(--zt-space-4);
  border-top: 1px solid var(--zt-border);
}

@media (max-width: 767.98px) {
  .zt-form__actions .btn {
    flex: 1 1 auto;
  }
}

/* --------------------------------------------------------------------------
   Choices.js (select recherchable) — le CDN est un thème clair
   --------------------------------------------------------------------------
   Purpose:  Aligner le contrôle et la liste sur les champs .form-select.
   Actions:  Fond, texte, bordure, survol et pastilles multi-select.
   Logic:    Sélecteurs plus spécifiques que choices.min.css (thème + classes)
             pour gagner même si le CDN est chargé après ui.css.
   Position: Formulaires rapport (événement) et événement (assignés).
   -------------------------------------------------------------------------- */
[data-bs-theme="dark"] .choices {
  margin-bottom: 0;
  font-size: var(--zt-text-md);
  color: var(--zt-text);
}

[data-bs-theme="dark"] .choices__inner {
  background-color: var(--zt-bg-page);
  border: 1px solid var(--zt-border-strong);
  border-radius: var(--zt-radius-md);
  color: var(--zt-text);
  min-height: 0;
  padding: 0.375rem 0.75rem;
  font-size: var(--zt-text-md);
}

[data-bs-theme="dark"] .choices.is-focused .choices__inner,
[data-bs-theme="dark"] .choices.is-open .choices__inner {
  border-color: var(--zt-primary-border);
  box-shadow: 0 0 0 0.25rem var(--zt-primary-focus);
}

[data-bs-theme="dark"] .choices.is-open .choices__inner {
  border-radius: var(--zt-radius-md) var(--zt-radius-md) 0 0;
}

[data-bs-theme="dark"] .choices.is-disabled .choices__inner,
[data-bs-theme="dark"] .choices.is-disabled .choices__input {
  background-color: var(--zt-bg-subtle);
  color: var(--zt-text-muted);
}

[data-bs-theme="dark"] .choices__input,
[data-bs-theme="dark"] .choices[data-type*="select-one"] .choices__input {
  background-color: var(--zt-bg-page);
  color: var(--zt-text);
  border-color: var(--zt-border);
}

[data-bs-theme="dark"] .choices__input::placeholder {
  color: var(--zt-text-muted);
}

[data-bs-theme="dark"] .choices__list--single .choices__item,
[data-bs-theme="dark"] .choices__item {
  color: var(--zt-text);
}

[data-bs-theme="dark"] .choices__placeholder {
  color: var(--zt-text-muted);
  opacity: 1;
}

[data-bs-theme="dark"] .choices__list--dropdown,
[data-bs-theme="dark"] .choices__list[aria-expanded] {
  background-color: var(--zt-bg-surface);
  border-color: var(--zt-border-strong);
  color: var(--zt-text);
  z-index: 5;
}

[data-bs-theme="dark"] .choices.is-open .choices__list--dropdown,
[data-bs-theme="dark"] .choices.is-open .choices__list[aria-expanded] {
  border-color: var(--zt-border-strong);
}

[data-bs-theme="dark"] .choices__list--dropdown .choices__item,
[data-bs-theme="dark"] .choices__list[aria-expanded] .choices__item {
  color: var(--zt-text);
}

[data-bs-theme="dark"] .choices__list--dropdown .choices__item--selectable.is-highlighted,
[data-bs-theme="dark"] .choices__list[aria-expanded] .choices__item--selectable.is-highlighted {
  background-color: var(--zt-bg-hover);
  color: var(--zt-text);
}

[data-bs-theme="dark"] .choices__list--dropdown .choices__item--selectable.is-highlighted::after,
[data-bs-theme="dark"] .choices__list[aria-expanded] .choices__item--selectable.is-highlighted::after {
  color: var(--zt-text-muted);
}

[data-bs-theme="dark"] .choices__heading {
  border-bottom-color: var(--zt-border);
  color: var(--zt-text-secondary);
}

[data-bs-theme="dark"] .choices__list--multiple .choices__item {
  background-color: var(--zt-primary-soft);
  border-color: var(--zt-primary-border);
  color: var(--zt-primary-text);
}

[data-bs-theme="dark"] .choices__list--multiple .choices__item.is-highlighted {
  background-color: var(--zt-primary);
  border-color: var(--zt-primary);
  color: var(--bs-emphasis-color);
}

/* --------------------------------------------------------------------------
   Modales : densité et titres alignés sur les sections
   -------------------------------------------------------------------------- */
.zt-modal .modal-header,
.modal-content.zt-modal .modal-header {
  padding: var(--zt-space-4);
}

.zt-modal .modal-body {
  padding: var(--zt-space-4);
}

.zt-modal .modal-footer {
  padding: var(--zt-space-3) var(--zt-space-4);
  gap: var(--zt-space-2);
}

/* --------------------------------------------------------------------------
   Barre d'outils au-dessus d'une liste
   -------------------------------------------------------------------------- */
.zt-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--zt-space-3);
}

.zt-toolbar .zt-field {
  margin-bottom: 0;
  min-width: 10rem;
}

.zt-toolbar .zt-form__actions {
  margin-left: auto;
  padding: 0;
  border: 0;
}

/* --------------------------------------------------------------------------
   Tableau dense
   -------------------------------------------------------------------------- */
.zt-table,
.table,
.modern-table {
  width: 100%;
  margin: 0;
  font-size: var(--zt-text-sm);
  color: var(--zt-text);
  border-collapse: collapse;
}

.zt-table th,
.zt-table td,
.table th,
.table td,
.modern-table th,
.modern-table td,
.table-header-cell,
.table-cell {
  padding: var(--zt-space-3) var(--zt-space-4);
  border-bottom: 1px solid var(--zt-border);
  text-align: left;
  vertical-align: middle;
}

.zt-table th,
.table thead th,
.modern-table thead th,
.table-header,
.table-header-cell,
.table-light th {
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--zt-bg-subtle);
  border-color: var(--zt-border);
}

.zt-table tbody tr:hover td,
.table tbody tr:hover td,
.modern-table tbody tr:hover td {
  background: var(--zt-bg-hover);
  color: var(--zt-text);
}

.zt-table a,
.table a,
.issue-title-link {
  color: var(--zt-text);
  font-weight: var(--zt-weight-medium);
  text-decoration: none;
}

.zt-table a:hover,
.table a:hover,
.issue-title-link:hover {
  color: var(--zt-primary-text);
}

/* Rangée d'actions du pied de la modale calendrier (Create Report / Create issue).
   Purpose: Aligner les boutons Bootstrap déjà étiquetés sans les forcer en carré.
   Actions: Flex wrap + gap tokens ; les listes restent sur .zt-table__actions + .zt-icon-btn.
   Logic: Pas de width/height fixes ici — le libellé « Create Report » doit rester lisible.
   Position: Pied de #eventModal et autres rangées d'actions hors .zt-table__actions. */
.table-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2);
}

.zt-table__actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--zt-space-1);
}

.zt-table__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
}

.zt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
  padding: 0.125rem;
  margin: 0 0 var(--zt-space-5);
  list-style: none;
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-subtle);
}

.zt-tabs .nav-link,
.nav-pills .nav-link {
  padding: 0.375rem var(--zt-space-4);
  border: 0;
  border-radius: var(--zt-radius-sm);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
}

.zt-tabs .nav-link.active,
.nav-pills .nav-link.active {
  background: var(--zt-bg-surface);
  color: var(--zt-text);
  box-shadow: 0 0 0 1px var(--zt-border);
}

/* --------------------------------------------------------------------------
   Chiffres clés (dashboard)
   -------------------------------------------------------------------------- */
.zt-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11.5rem, 1fr));
  gap: var(--zt-space-3);
  margin-bottom: var(--zt-space-5);
}

.zt-stat {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-1);
  min-width: 0;
  padding: var(--zt-space-4);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
  background: var(--zt-bg-surface);
  color: inherit;
  text-decoration: none;
}

a.zt-stat:hover {
  background: var(--zt-bg-hover);
  color: inherit;
}

.zt-stat__value {
  font-size: var(--zt-text-xl);
  font-weight: var(--zt-weight-semibold);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--zt-text);
}

.zt-stat__label {
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.zt-stat__trend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-1);
  margin-top: var(--zt-space-1);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-muted);
}

.zt-trend--success { color: var(--zt-success-strong); }
.zt-trend--warning { color: var(--zt-warning-strong); }
.zt-trend--danger { color: var(--zt-danger-strong); }

.zt-stat--danger {
  border-color: var(--zt-danger);
}

.zt-stat--danger .zt-stat__value {
  color: var(--zt-danger-strong);
}

/* --------------------------------------------------------------------------
   Graphiques KPI (hauteur fixe pour Chart.js, tokens uniquement)
   --------------------------------------------------------------------------
   Purpose:  Cadres canvas et barre de taux utilisés par /kpi.
   Actions:  Les ids canvas restent dans le template ; kpi.js lit les tokens.
   Logic:    Pas de hex ni d'ombre ; --tall / --pie reprennent les hauteurs
             de l'ancien bloc <style>.
   Position: Étape B11 ; chargé globalement avec les autres zt-*.
   -------------------------------------------------------------------------- */
.zt-chart {
  position: relative;
  height: 25rem;
}

.zt-chart--pie {
  height: 18.75rem;
}

.zt-chart--tall {
  height: 31.25rem;
}

.zt-progress {
  display: inline-block;
  width: 3.75rem;
  height: 0.5rem;
  overflow: hidden;
  vertical-align: middle;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-bg-subtle);
}

.zt-progress__bar {
  height: 100%;
  background: var(--zt-success);
}

.zt-section__header .ms-auto {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Grille et listes du tableau de bord
   -------------------------------------------------------------------------- */
.zt-dash {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(16rem, 20rem);
  gap: var(--zt-space-5);
  align-items: start;
}

@media (max-width: 991.98px) {
  .zt-dash {
    grid-template-columns: 1fr;
  }
}

.zt-feed {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.zt-feed-item {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
  padding: var(--zt-space-3) 0;
  border-bottom: 1px solid var(--zt-border);
}

.zt-feed-item:first-child {
  padding-top: 0;
}

.zt-feed-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.zt-feed-item__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--zt-space-2);
}

.zt-feed-item__title {
  min-width: 0;
  color: var(--zt-text);
  font-weight: var(--zt-weight-medium);
  text-decoration: none;
}

.zt-feed-item__title:hover {
  color: var(--zt-primary-text);
}

.zt-feed-item__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2) var(--zt-space-3);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.zt-feed-item__meta--danger {
  color: var(--zt-danger-strong);
  font-weight: var(--zt-weight-medium);
}

.zt-progress {
  height: 0.5rem;
  overflow: hidden;
  border-radius: var(--zt-radius-pill);
  background: var(--zt-bg-subtle);
}

.zt-progress__bar {
  height: 100%;
  border-radius: inherit;
  background: var(--zt-success);
}

.zt-progress__bar--warning {
  background: var(--zt-warning);
}

.zt-truncate {
  max-width: 12.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Board Kanban
   --------------------------------------------------------------------------
   Purpose: Colonnes et cartes du tableau, sans ombre, tokens uniquement.
   Actions: .zt-page--wide élargit le container ; .zt-board pose la grille ;
            .zt-card habille une carte. Les classes historiques .kanban-column,
            .kanban-cards, .kanban-card, .column-count restent pour le JS.
   Logic:   Le script de glisser-déposer cible ces classes et les id
            #column-<statut> ; le style se greffe sans les remplacer.
   Position: Créé pour l'étape B3 (templates/kanban/*).
   -------------------------------------------------------------------------- */
main.container:has(.zt-page--wide) {
  max-width: none;
}

.zt-board,
.kanban-board {
  display: grid;
  grid-template-columns: repeat(5, minmax(15rem, 1fr));
  gap: var(--zt-space-4);
  align-items: stretch;
  overflow-x: auto;
}

.zt-board--sample {
  grid-template-columns: repeat(2, minmax(12rem, 1fr));
}

.zt-board-col,
.kanban-column {
  display: flex;
  flex-direction: column;
  min-width: 15rem;
  min-height: 24rem;
  padding: var(--zt-space-3);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
  background: var(--zt-bg-subtle);
}

.zt-board-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zt-space-2);
  margin-bottom: var(--zt-space-3);
  padding-bottom: var(--zt-space-3);
  border-bottom: 1px solid var(--zt-border);
}

.zt-board-col__title {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text);
}

.zt-board-col__count,
.column-count {
  min-width: 1.5rem;
  padding: 0.125rem var(--zt-space-2);
  border-radius: var(--zt-radius-pill);
  background: var(--zt-bg-surface);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-semibold);
  text-align: center;
}

.kanban-cards {
  flex: 1;
  min-height: 16rem;
}

.kanban-column.drag-over,
.kanban-cards.drag-over {
  outline: 1px dashed var(--zt-primary-text);
  background: var(--zt-bg-hover);
}

.zt-card,
.kanban-card {
  position: relative;
  padding: var(--zt-space-3);
  margin-bottom: var(--zt-space-3);
  border: 1px solid var(--zt-border);
  border-left-width: 3px;
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-surface);
  cursor: grab;
}

.kanban-card:hover {
  background: var(--zt-bg-hover);
  cursor: pointer;
}

.kanban-card:active {
  cursor: grabbing;
}

.kanban-card.dragging {
  opacity: 0.5;
}

.kanban-card.drag-over {
  outline: 1px dashed var(--zt-primary-text);
}

.zt-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--zt-space-2);
  margin-bottom: var(--zt-space-2);
}

.zt-card__id {
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  color: var(--zt-text-secondary);
}

.zt-card__title {
  margin-bottom: var(--zt-space-2);
  font-weight: var(--zt-weight-semibold);
  line-height: 1.4;
  color: var(--zt-text);
}

.zt-card__project {
  display: inline-block;
  margin-bottom: var(--zt-space-2);
  padding: 0.125rem var(--zt-space-2);
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-hover);
  color: var(--zt-text);
  font-size: var(--zt-text-xs);
}

.zt-card__people {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--zt-space-2);
  margin-bottom: var(--zt-space-2);
}

.zt-card__people-label {
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  color: var(--zt-text-secondary);
}

.zt-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zt-space-2);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-secondary);
}

.zt-card__counts {
  display: inline-flex;
  align-items: center;
  gap: var(--zt-space-2);
}

.zt-card__count {
  display: inline-flex;
  align-items: center;
  gap: 0.125rem;
  padding: 0.125rem var(--zt-space-2);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-sm);
  background: var(--zt-bg-subtle);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-primary-text);
}

.zt-card__due--overdue {
  font-weight: var(--zt-weight-medium);
  color: var(--zt-danger-strong);
}

.zt-card__due--soon {
  font-weight: var(--zt-weight-medium);
  color: var(--zt-warning-strong);
}

.zt-card__resolved {
  font-weight: var(--zt-weight-medium);
  color: var(--zt-success-strong);
}

.zt-card__hint {
  margin-top: var(--zt-space-2);
  font-size: var(--zt-text-xs);
  color: var(--zt-text-muted);
  text-align: center;
}

.kanban-card:hover .zt-card__hint {
  color: var(--zt-primary-text);
}

.zt-card__flag {
  position: absolute;
  top: var(--zt-space-1);
  font-size: var(--zt-text-sm);
}

.zt-card__flag--end {
  right: var(--zt-space-1);
  color: var(--zt-danger-strong);
}

.zt-card__flag--start {
  left: var(--zt-space-1);
  color: var(--zt-warning-strong);
}

@media (max-width: 767.98px) {
  .zt-board,
  .kanban-board {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Aide (documentation) — remplace help.css, tokens uniquement
   --------------------------------------------------------------------------
   Purpose:  Sommaire collant, sections, grilles, FAQ et tableaux de /help.
   Actions:  Les ids #helpSearch / #helpToc et .help-toc-link / .help-section
             restent pour public/js/help.js.
   Logic:    Pas d'ombre ni de dégradé hex ; le hero suit zt-section.
   Position: Chargé globalement ; help.css n'est plus lié (C2 pourra le retirer).
   -------------------------------------------------------------------------- */
.help-container {
  display: flex;
  gap: var(--zt-space-6);
  align-items: flex-start;
}

.help-sidebar {
  position: sticky;
  top: var(--zt-space-6);
  width: 16rem;
  flex-shrink: 0;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  padding: var(--zt-space-4);
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
}

.help-search {
  position: relative;
  margin-bottom: var(--zt-space-4);
}

.help-search input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2rem;
  border: 1px solid var(--zt-border-strong);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-page);
  color: var(--zt-text);
  font-size: var(--zt-text-sm);
}

.help-search input:focus {
  outline: none;
  border-color: var(--zt-primary-border);
  box-shadow: 0 0 0 0.25rem var(--zt-primary-focus);
}

.help-search i {
  position: absolute;
  left: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--zt-text-muted);
}

.help-toc {
  list-style: none;
  padding: 0;
  margin: 0;
}

.help-toc-item {
  margin-bottom: var(--zt-space-1);
}

.help-toc-link {
  display: flex;
  align-items: center;
  gap: var(--zt-space-2);
  padding: 0.4rem 0.6rem;
  color: var(--zt-text-secondary);
  text-decoration: none;
  border-radius: var(--zt-radius-md);
  font-size: var(--zt-text-sm);
}

.help-toc-link:hover {
  background: var(--zt-bg-hover);
  color: var(--zt-text);
}

.help-toc-link.active {
  background: var(--zt-primary-soft);
  color: var(--zt-primary-text);
  font-weight: var(--zt-weight-medium);
}

.help-content {
  flex: 1;
  min-width: 0;
}

.help-hero {
  margin-bottom: var(--zt-space-6);
  padding: var(--zt-space-6);
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
}

.help-hero h1 {
  margin-bottom: var(--zt-space-2);
  font-size: 1.5rem;
  color: var(--zt-text);
}

.help-hero p {
  margin-bottom: var(--zt-space-4);
  color: var(--zt-text-secondary);
}

.help-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--zt-space-2);
}

.help-section {
  margin-bottom: var(--zt-space-6);
  padding: var(--zt-space-6);
  background: var(--zt-bg-surface);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-lg);
  scroll-margin-top: var(--zt-space-6);
}

.help-section-header {
  margin-bottom: var(--zt-space-4);
  padding-bottom: var(--zt-space-3);
  border-bottom: 1px solid var(--zt-border);
}

.help-section-title {
  display: flex;
  align-items: center;
  gap: var(--zt-space-3);
  margin-bottom: var(--zt-space-1);
  font-size: 1.25rem;
  color: var(--zt-text);
}

.help-section-icon {
  display: flex;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  border-radius: var(--zt-radius-md);
  background: var(--zt-primary-soft);
  color: var(--zt-primary-text);
}

.help-section-subtitle,
.help-heading {
  color: var(--zt-text-secondary);
}

.help-heading {
  margin-top: var(--zt-space-6);
  margin-bottom: var(--zt-space-3);
  font-size: var(--zt-text-md);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text);
}

.help-alert {
  display: flex;
  gap: var(--zt-space-3);
  margin: var(--zt-space-4) 0;
  padding: var(--zt-space-3) var(--zt-space-4);
  border: 1px solid var(--zt-primary-border);
  border-radius: var(--zt-radius-md);
  background: var(--zt-primary-soft);
  color: var(--zt-text);
}

.help-feature-grid,
.help-role-grid,
.help-status-grid {
  display: grid;
  gap: var(--zt-space-4);
  margin: var(--zt-space-4) 0;
}

.help-feature-grid {
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.help-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.help-status-grid {
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
}

.help-feature-card,
.help-role-card,
.help-status-badge,
.help-workflow-step {
  padding: var(--zt-space-4);
  background: var(--zt-bg-page);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
}

.help-feature-icon,
.help-role-icon,
.help-status-icon,
.help-step-number {
  display: flex;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--zt-space-3);
  border-radius: var(--zt-radius-md);
  color: var(--bs-emphasis-color);
}

.help-feature-card h6,
.help-role-title,
.help-step-content h6,
.help-status-badge span {
  margin-bottom: var(--zt-space-1);
  font-weight: var(--zt-weight-semibold);
  color: var(--zt-text);
}

.help-feature-card p,
.help-role-permissions,
.help-step-content p,
.help-status-badge p {
  margin: 0;
  font-size: var(--zt-text-sm);
  color: var(--zt-text-secondary);
}

.help-role-header {
  display: flex;
  align-items: center;
  gap: var(--zt-space-3);
  margin-bottom: var(--zt-space-3);
  padding-bottom: var(--zt-space-3);
  border-bottom: 1px solid var(--zt-border);
}

.help-role-icon {
  margin-bottom: 0;
}

.help-role-permissions ul {
  margin: 0;
  padding-left: 1.1rem;
}

.help-role-permissions li {
  margin-bottom: var(--zt-space-1);
}

.help-note {
  margin-top: var(--zt-space-3);
  padding-top: var(--zt-space-3);
  border-top: 1px solid var(--zt-border);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
}

.help-workflow {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-3);
  margin: var(--zt-space-4) 0;
}

.help-workflow-step {
  display: flex;
  gap: var(--zt-space-4);
  align-items: flex-start;
  border-left: 3px solid var(--zt-primary);
}

.help-step-number {
  flex-shrink: 0;
  margin-bottom: 0;
  background: var(--zt-primary);
  font-weight: var(--zt-weight-semibold);
}

.help-step-badge {
  display: inline-block;
  margin-top: var(--zt-space-2);
  padding: 0.15rem 0.5rem;
  border-radius: var(--zt-radius-sm);
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-medium);
  color: var(--bs-emphasis-color);
}

.help-status-icon {
  margin: 0 auto var(--zt-space-3);
}

.help-status-badge {
  text-align: center;
}

.help-table-wrapper {
  overflow-x: auto;
  margin: var(--zt-space-4) 0;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
}

.help-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  background: var(--zt-bg-surface);
}

.help-table th,
.help-table td {
  padding: var(--zt-space-3);
  border-top: 1px solid var(--zt-border);
  font-size: var(--zt-text-sm);
  color: var(--zt-text);
  text-align: left;
}

.help-table thead th {
  border-top: 0;
  background: var(--zt-bg-subtle);
  color: var(--zt-text-secondary);
  font-weight: var(--zt-weight-medium);
}

.help-faq-item {
  margin-bottom: var(--zt-space-2);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-page);
}

.help-faq-question {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: var(--zt-space-3) var(--zt-space-4);
  border: 0;
  background: transparent;
  color: var(--zt-text);
  font-weight: var(--zt-weight-semibold);
  text-align: left;
  cursor: pointer;
}

.help-faq-question i {
  color: var(--zt-text-muted);
}

.help-faq-question.collapsed i {
  transform: rotate(-90deg);
}

.help-faq-answer {
  padding: 0 var(--zt-space-4) var(--zt-space-4);
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
}

@media (max-width: 1024px) {
  .help-container {
    flex-direction: column;
  }

  .help-sidebar {
    position: static;
    width: 100%;
    max-height: 16rem;
  }
}

@media (max-width: 767.98px) {
  .help-feature-grid,
  .help-role-grid {
    grid-template-columns: 1fr;
  }

  .help-workflow-step {
    flex-direction: column;
  }
}

/* Toasts flash (base.html.twig + kanban showNotification).
   Purpose: Positionner le container et colorer les types via les tokens.
   Actions: Succès / danger / warning / info / secondary / primary ; bouton fermer clair.
   Logic: Reliquat de toasts.css sans ombre, dégradé, hover-lift ni hex inline.
   Position: Remplace public/css/toasts.css (C2). */
.toast-container {
  position: fixed;
  top: var(--zt-space-4);
  right: var(--zt-space-4);
  z-index: 1055;
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-3);
  max-width: 25rem;
  width: auto;
}

@media (max-width: 576px) {
  .toast-container {
    top: var(--zt-space-2);
    right: var(--zt-space-2);
    left: var(--zt-space-2);
    max-width: 100%;
  }
}

.toast {
  min-width: 18.75rem;
  max-width: 25rem;
  border-radius: var(--zt-radius-lg);
  border: 1px solid transparent;
  font-size: var(--zt-text-md);
  font-weight: var(--zt-weight-medium);
  line-height: 1.5;
}

.toast-body {
  padding: var(--zt-space-4) var(--zt-space-5);
  display: flex;
  align-items: center;
  gap: var(--zt-space-3);
  flex: 1;
}

.toast-body i {
  font-size: var(--zt-text-lg);
  flex-shrink: 0;
}

.toast-body > * {
  margin: 0;
}

.toast.bg-success {
  background: var(--zt-success) !important;
  color: var(--zt-gray-0) !important;
}

.toast.bg-danger {
  background: var(--zt-danger) !important;
  color: var(--zt-gray-0) !important;
}

.toast.bg-warning {
  background: var(--zt-warning) !important;
  color: var(--zt-gray-0) !important;
}

.toast.bg-info {
  background: var(--zt-info) !important;
  color: var(--zt-gray-0) !important;
}

.toast.bg-secondary {
  background: var(--zt-gray-600) !important;
  color: var(--zt-gray-0) !important;
}

.toast.bg-primary {
  background: var(--zt-primary) !important;
  color: var(--zt-gray-0) !important;
}

.toast .btn-close,
.toast .btn-close-white {
  filter: brightness(0) invert(1);
  opacity: 0.8;
  margin: var(--zt-space-2);
  padding: var(--zt-space-2);
}

.toast .btn-close:hover {
  opacity: 1;
}

@media (max-width: 768px) {
  .toast {
    min-width: 17.5rem;
    max-width: 100%;
    font-size: var(--zt-text-sm);
  }

  .toast-body {
    padding: var(--zt-space-3) var(--zt-space-4);
  }
}

@media (max-width: 576px) {
  .toast {
    min-width: auto;
    width: 100%;
  }
}

/* --------------------------------------------------------------------------
   Apparence (interrupteur + cartes de profil)
   Purpose:  Choix Dark / Light, tokens uniquement.
   Actions:  États .is-active / aria-pressed gérés par theme.js.
   Logic:    Track compact pour le menu compte ; cartes pour le profil.
   Position: Menu utilisateur, profil, login.
   -------------------------------------------------------------------------- */
.zt-theme-switch {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-2);
  padding: var(--zt-space-2) var(--zt-space-3) var(--zt-space-3);
}

.zt-theme-switch__label {
  font-size: var(--zt-text-xs);
  font-weight: var(--zt-weight-semibold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--zt-text-secondary);
}

.zt-theme-switch__track {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--zt-space-1);
  padding: var(--zt-space-1);
  background: var(--zt-bg-subtle);
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
}

.zt-theme-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--zt-space-2);
  padding: var(--zt-space-2) var(--zt-space-3);
  border: 0;
  border-radius: var(--zt-radius-sm);
  background: transparent;
  color: var(--zt-text-secondary);
  font-size: var(--zt-text-sm);
  font-weight: var(--zt-weight-medium);
  line-height: 1.2;
}

.zt-theme-switch__btn:hover {
  color: var(--zt-text);
  background: var(--zt-bg-hover);
}

.zt-theme-switch__btn.is-active {
  background: var(--zt-bg-surface);
  color: var(--zt-text);
  box-shadow: var(--zt-shadow-sm);
}

.zt-theme-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--zt-space-3);
}

.zt-theme-choice {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-3);
  padding: var(--zt-space-3);
  text-align: left;
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  background: var(--zt-bg-surface);
  color: var(--zt-text);
}

.zt-theme-choice:hover {
  border-color: var(--zt-border-strong);
  background: var(--zt-bg-hover);
}

.zt-theme-choice.is-active {
  border-color: var(--zt-primary);
  box-shadow: 0 0 0 1px var(--zt-primary);
}

.zt-theme-choice__preview {
  display: block;
  height: 4.5rem;
  border-radius: var(--zt-radius-sm);
  border: 1px solid var(--zt-border);
}

.zt-theme-choice__preview--dark {
  background: linear-gradient(135deg, var(--zt-gray-900) 0 55%, var(--zt-gray-800) 55%);
}

.zt-theme-choice__preview--light {
  background: linear-gradient(135deg, var(--zt-gray-50) 0 55%, var(--zt-gray-0) 55%);
}

.zt-theme-choice__copy {
  display: flex;
  flex-direction: column;
  gap: var(--zt-space-1);
}

.zt-theme-choice__name {
  font-weight: var(--zt-weight-semibold);
  font-size: var(--zt-text-sm);
}

@media (max-width: 576px) {
  .zt-theme-choices {
    grid-template-columns: 1fr;
  }
}

/* Fiche MMS : gros cibles pour téléphone et tablette */
.mms-sheet .form-control,
.mms-sheet .form-select,
.mms-finding .form-control,
.mms-finding .form-select {
  min-height: 48px;
  font-size: 16px;
}

.mms-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mms-actions .btn,
.mms-actions form {
  flex: 1 1 140px;
}

.mms-actions .btn {
  min-height: 48px;
  width: 100%;
}

.mms-group {
  margin-top: 1.25rem;
}

.mms-group__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.mms-group__bar h3 {
  margin: 0;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.mms-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--zt-border);
}

.mms-item__label {
  display: block;
  font-size: 1.05rem;
  line-height: 1.3;
}

.mms-item__help {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--zt-text-muted);
}

.mms-item__help summary,
.mms-item__note summary {
  cursor: pointer;
  min-height: 32px;
}

.mms-item__help p {
  margin: 4px 0 0;
}

.mms-choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}

.mms-choice__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mms-choice__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  border-radius: 10px;
  border: 2px solid var(--zt-border);
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
}

.mms-fold__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--zt-space-2);
  padding: var(--zt-space-3) var(--zt-space-4);
  cursor: pointer;
  font-weight: var(--zt-weight-semibold);
  list-style: none;
}

.mms-fold__summary::-webkit-details-marker {
  display: none;
}

.mms-fold__summary::after {
  content: "▸";
  color: var(--zt-text-secondary);
}

.mms-fold[open] > .mms-fold__summary::after {
  content: "▾";
}

.mms-fold[open] > .mms-fold__summary {
  border-bottom: 1px solid var(--zt-border);
}

.mms-choice__btn--na {
  grid-column: 1 / -1;
  min-height: 44px;
  color: var(--zt-text-secondary);
  font-weight: var(--zt-weight-medium);
}

.mms-choice__btn--yes { color: var(--zt-success-strong); }
.mms-choice__btn--no { color: var(--zt-danger-strong); }

.mms-choice__input:checked + .mms-choice__btn--na {
  background: var(--zt-bg-subtle);
  border-color: var(--zt-text-secondary);
  color: var(--zt-text);
}

.mms-choice__input:checked + .mms-choice__btn--yes {
  background: var(--zt-success-soft);
  border-color: var(--zt-success);
}

.mms-choice__input:checked + .mms-choice__btn--no {
  background: var(--zt-danger-soft);
  border-color: var(--zt-danger);
}

.mms-choice__input:disabled + .mms-choice__btn {
  opacity: 0.65;
  cursor: default;
}

.mms-item__note {
  margin-top: 8px;
}

.mms-item__warn {
  margin: 8px 0 0;
  color: var(--zt-danger-strong);
  font-size: 0.9rem;
}

.mms-sticky {
  position: sticky;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 16px -4px 0;
  padding: 12px;
  background: var(--zt-bg-surface);
  border-top: 1px solid var(--zt-border);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
}

.mms-sticky .btn {
  min-height: 52px;
  min-width: 140px;
  font-weight: 700;
}

.mms-finding.is-highlight {
  outline: 3px solid var(--zt-danger);
  outline-offset: 4px;
}

.isb-room-card[hidden] {
  display: none !important;
}

.mms-dossier__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--zt-space-3);
}

.mms-read {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--zt-space-3);
  padding: var(--zt-space-2) 0;
  border-bottom: 1px solid var(--zt-border);
}

.mms-read__note {
  color: var(--zt-text-secondary);
  font-size: 0.85rem;
}

.mms-read__value {
  font-weight: var(--zt-weight-semibold);
  white-space: nowrap;
}

.mms-read__value.is-yes { color: var(--zt-success-strong); }
.mms-read__value.is-no { color: var(--zt-danger-strong); }
.mms-read__value.is-muted { color: var(--zt-text-secondary); font-weight: var(--zt-weight-medium); }

.mms-free-comment {
  white-space: pre-wrap;
  margin: 0;
}

.mms-finding-card {
  border: 1px solid var(--zt-border);
  border-radius: var(--zt-radius-md);
  padding: var(--zt-space-3);
  margin-bottom: var(--zt-space-3);
}

.mms-finding-photo {
  max-height: 120px;
  border-radius: 6px;
}

@media (max-width: 767.98px) {
  .mms-sticky {
    margin-left: -12px;
    margin-right: -12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}
