/* ==========================================================================
   Espace client Neutrino — styles. Toutes les couleurs viennent de tokens.css
   (thème clair par défaut, sombre via data-theme="dark" ou préférence système).
   Aucune couleur codée en dur dans ce fichier.
   ========================================================================== */

:root {
  color-scheme: light dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--anneau-focus);
  outline-offset: 2px;
}

body {
  margin: 0;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

.lien-evitement {
  position: absolute;
  left: var(--space-4);
  top: -100px;
  padding: var(--space-2) var(--space-3);
  background: var(--action);
  color: var(--sur-action);
  border-radius: var(--radius-sm);
}

.lien-evitement:focus {
  top: var(--space-2);
}

/* --- En-tête et bandeau ------------------------------------------------- */

.entete {
  background: var(--surface);
  border-bottom: 1px solid var(--bordure);
}

.entete-interieur {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.marque {
  font-size: 18px;
  font-weight: 600;
}

.marque-suite {
  font-weight: 400;
  color: var(--texte-desactive);
}

.navigation {
  display: flex;
  gap: var(--space-3);
  flex: 1;
  flex-wrap: wrap;
}

.navigation a {
  color: var(--texte);
  text-decoration: none;
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

.navigation a[aria-current="page"] {
  background: var(--action-doux);
  color: var(--action-texte);
  font-weight: 600;
}

.bandeau-lecture-seule {
  background: var(--attention-doux);
  color: var(--attention-texte);
  border-bottom: 1px solid var(--bordure);
  padding: var(--space-3) var(--space-4);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.bandeau-lecture-seule p {
  margin: 0;
  font-weight: 600;
}

/* --- Contenu ------------------------------------------------------------- */

.contenu {
  max-width: 960px;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
}

.contenu:focus {
  outline: none;
}

.titre-page {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 var(--space-4);
}

.titre-section {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.chargement,
.aide {
  color: var(--texte-desactive);
  font-size: 14px;
}

.message {
  margin: 0 0 var(--space-4);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 14px;
}

.message-erreur {
  background: var(--danger-doux);
  color: var(--danger-texte);
}

.message-succes {
  background: var(--succes-doux);
  color: var(--succes-texte);
}

/* --- Tuiles -------------------------------------------------------------- */

.tuiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-4);
}

.tuile {
  background: var(--surface);
  border: 1px solid var(--bordure);
  border-radius: var(--radius-lg);
  box-shadow: var(--ombre-1);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

a.tuile {
  color: inherit;
  text-decoration: none;
}

a.tuile:hover {
  box-shadow: var(--ombre-2);
}

.tuile-entete {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-2);
}

.tuile dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-1) var(--space-3);
  margin: 0;
  font-size: 14px;
}

.tuile dt {
  color: var(--texte-desactive);
}

.tuile dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.tuile-total {
  font-size: 18px;
  font-weight: 600;
}

.pastille {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--texte);
}

.pastille::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--action);
}

/* --- Formulaires et boutons ---------------------------------------------- */

.formulaire {
  display: grid;
  gap: var(--space-4);
  max-width: 520px;
}

.champ {
  display: grid;
  gap: var(--space-1);
  font-size: 14px;
  font-weight: 600;
}

.champ input,
.champ textarea {
  font: inherit;
  font-weight: 400;
  color: var(--texte);
  background: var(--surface);
  border: 1px solid var(--bordure-controle);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  min-height: var(--hauteur-controle);
}

.champ textarea {
  min-height: 120px;
  resize: vertical;
}

.btn {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  min-height: var(--hauteur-controle);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--action);
  background: var(--action);
  color: var(--sur-action);
  cursor: pointer;
}

.btn:disabled {
  cursor: progress;
  opacity: 0.6;
}

.btn-secondaire {
  background: var(--surface);
  color: var(--texte);
  border-color: var(--bordure-controle);
}

.btn-lien {
  background: none;
  border: 0;
  padding: 0;
  min-height: 0;
  color: var(--action-texte);
  font-weight: 600;
  text-decoration: underline;
}

.actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  align-items: center;
}

/* --- Détail du ticket ----------------------------------------------------- */

.grille-detail {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-4);
}

.liste-simple {
  margin: 0;
  padding-left: var(--space-5);
  font-size: 14px;
}

.photos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
}

.photos img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--bordure);
}

.rapport {
  white-space: pre-wrap;
  font-size: 14px;
  margin: 0;
}

/* --- Tableau des tickets ------------------------------------------------- */

.tableau-conteneur {
  overflow-x: auto;
  border: 1px solid var(--bordure);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--ombre-1);
}

.tableau-tickets {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.tableau-tickets th,
.tableau-tickets td {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  border-bottom: 1px solid var(--bordure);
  vertical-align: middle;
}

.tableau-tickets th {
  font-size: 13px;
  font-weight: 600;
  color: var(--texte-desactive);
  background: var(--surface-2);
}

.tableau-tickets tbody tr:last-child td {
  border-bottom: 0;
}

.tableau-tickets tbody tr:hover {
  background: var(--survol-ligne, var(--surface-2));
}

.tableau-tickets a {
  color: var(--action-texte);
  font-weight: 600;
}

.tableau-tickets .nombre {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* Sur téléphone : chaque ligne devient un bloc, l'intitulé de chaque cellule vient de data-libelle. */
@media (max-width: 600px) {
  .tableau-tickets thead {
    display: none;
  }

  .tableau-tickets,
  .tableau-tickets tbody,
  .tableau-tickets tr,
  .tableau-tickets td {
    display: block;
    width: 100%;
  }

  .tableau-tickets td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    border-bottom: 1px solid var(--bordure);
    text-align: right;
  }

  .tableau-tickets td::before {
    content: attr(data-libelle);
    color: var(--texte-desactive);
    font-size: 13px;
    text-align: left;
  }

  .tableau-tickets tr {
    border-bottom: 1px solid var(--bordure);
    padding: var(--space-2) 0;
  }
}

