/* ECPC Pro — charte ECPC : marine #0b2540, bleu #1a96d6 (texte : #0f6fa3), jaune #f5b400. Polices système. */
:root {
  --marine: #0b2540; --bleu: #0f6fa3; --jaune: #f5b400; --fond: #f3f6f9; --trait: #dbe3ea; --bord: #b7c4d0;
  --texte: #0b2540; --discret: #55636f; --moyen: #3d4a56;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--texte); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
[hidden] { display: none !important; }
h1 { font-size: 22px; margin: 0 0 12px; }
h2 { font-size: 15px; margin: 20px 0 8px; }
p { margin: 0 0 10px; }
a { color: var(--bleu); }
:focus-visible { outline: 3px solid var(--jaune); outline-offset: 2px; }
.cache-visuel { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Barre du haut */
.barre { position: sticky; top: 0; z-index: 20; background: var(--marine); color: #fff; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); }
.marque { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-height: 44px; }
.marque img { border-radius: 8px; }
.marque b { display: block; font-size: 16px; }
.marque small { display: block; font-size: 12px; color: #c5d3e0; }
.lien-barre { font: inherit; font-size: 13px; font-weight: 600; background: #1d3a5c; color: #fff; border: 0; border-radius: 10px;
  min-height: 44px; padding: 0 14px; cursor: pointer; }

/* Menu : en bas sur téléphone, à gauche sur tablette paysage et ordinateur */
.menu { position: fixed; z-index: 20; left: 0; right: 0; bottom: 0; display: flex; background: #fff; border-top: 1px solid var(--trait);
  padding-bottom: env(safe-area-inset-bottom); }
.menu-lien { flex: 1; min-height: 56px; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
  color: var(--discret); text-decoration: none; border-top: 3px solid transparent; }
.menu-actif { color: var(--bleu); border-top-color: var(--bleu); font-weight: 700; }

main { padding: 16px; max-width: 1280px; outline: none; }
.connecte main { padding-bottom: 88px; }

/* Cartes et listes */
.carte { background: #fff; border: 1px solid var(--trait); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.carte-alerte { background: #fff6d6; border-color: var(--jaune); margin-bottom: 10px; }
.liste { display: flex; flex-direction: column; gap: 10px; }
.ligne { text-decoration: none; color: var(--texte); }
.ligne-active { border: 2px solid var(--bleu); }
.ligne-haut { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.ligne-titre { font-size: 15px; font-weight: 700; }
.ligne-texte { font-size: 13px; color: var(--moyen); }
.discret { font-size: 12px; color: var(--discret); }
.aide { font-size: 12px; color: var(--discret); margin: 8px 0 0; }
.vide { color: var(--discret); padding: 16px 4px; }
.lien { font-size: 13px; font-weight: 700; }
.retour { display: inline-flex; align-items: center; min-height: 44px; font-size: 13px; font-weight: 700; text-decoration: none; }

.pastille { display: inline-block; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 999px; }
.pastille-jaune { background: #fff0c2; color: #5c4300; }
.pastille-bleu { background: #e3f1fa; color: #0b4f75; }
.pastille-gris { background: #eef1f4; color: var(--moyen); }
.pastille-vert { background: #dff3e4; color: #14532d; }
.pastille-rouge { background: #fde4d8; color: #7a2c0a; }

/* Boutons et champs */
.btn { font: inherit; font-size: 13px; font-weight: 700; background: var(--marine); color: #fff; border: 1px solid var(--marine);
  border-radius: 10px; min-height: 44px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; }
.btn:disabled { opacity: .5; cursor: default; }
.btn-contour { background: #fff; color: var(--marine); border-color: var(--bord); }
.btn-jaune { background: var(--jaune); color: var(--marine); border-color: var(--jaune); }
.btn-plein { background: var(--bleu); border-color: var(--bleu); min-height: 48px; font-size: 15px; flex: 1; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.rang { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rang > .champ { flex: 1; min-width: 160px; }
label { font-size: 12px; font-weight: 700; color: var(--discret); }
.champ { font: inherit; font-size: 15px; color: var(--texte); background: #fff; border: 1px solid var(--bord); border-radius: 10px;
  min-height: 44px; padding: 8px 10px; width: 100%; }
textarea.champ { resize: vertical; }
.champ-note { background: #fff6d6; }
.coche { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--texte); }
.coche input { width: 22px; height: 22px; accent-color: var(--bleu); flex-shrink: 0; }
.coche-ligne { justify-content: space-between; border-top: 1px solid #e6ecf1; }
.deux { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }

.puces { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.puce { font: inherit; font-size: 13px; font-weight: 600; background: #fff; color: var(--marine); border: 1px solid var(--bord);
  border-radius: 999px; min-height: 40px; padding: 0 14px; cursor: pointer; }
.puce-active { background: var(--marine); color: #fff; border-color: var(--marine); font-weight: 700; }

/* Accueil */
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tuile { background: #fff; border: 1px solid var(--trait); border-radius: 14px; padding: 14px; display: flex; flex-direction: column;
  gap: 2px; text-decoration: none; color: var(--texte); }
.tuile-nombre { font-size: 30px; font-weight: 700; line-height: 1.1; }
.tuile-titre { font-size: 13px; font-weight: 600; }
.tuile-detail { font-size: 12px; color: var(--discret); }

/* Ticket : fil de discussion et composeur */
.volets { display: block; }
.volets-ouvert .volet-liste { display: none; }
.volets:not(.volets-ouvert) .volet-detail { display: none; }
.fil { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.bulle { max-width: 86%; border-radius: 14px; padding: 10px 12px; display: flex; flex-direction: column; gap: 4px; }
.bulle-entete { font-size: 11px; font-weight: 700; }
.bulle-texte { font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bulle-client { align-self: flex-start; background: #fff; border: 1px solid var(--trait); }
.bulle-client .bulle-entete { color: var(--discret); }
.bulle-reponse { align-self: flex-end; background: var(--bleu); color: #fff; }
.bulle-reponse .bulle-entete { color: #e3f1fa; }
.bulle-note { align-self: stretch; max-width: none; background: #fff6d6; border: 1px dashed #b98900; }
.bulle-note .bulle-entete { color: #5c4300; }
.vignettes { display: flex; flex-wrap: wrap; gap: 8px; }
.vignette { width: 84px; height: 84px; object-fit: cover; border-radius: 10px; border: 1px solid var(--trait); display: block; background: #eef1f4; }
.apercu { position: relative; }
.croix { position: absolute; top: -8px; right: -8px; width: 28px; height: 28px; border-radius: 999px; border: 0; background: var(--marine);
  color: #fff; font-size: 16px; line-height: 1; cursor: pointer; }
.composeur { gap: 10px; margin-top: 12px; }
.bascule { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: #eef1f4; border-radius: 10px; padding: 4px; }
.bascule-btn { font: inherit; font-size: 13px; font-weight: 700; border: 0; border-radius: 8px; min-height: 40px; background: transparent;
  color: var(--moyen); cursor: pointer; }
.bascule-reponse { background: var(--bleu); color: #fff; }
.bascule-note { background: var(--jaune); color: var(--marine); }
.vocal { font-size: 13px; background: var(--fond); border-radius: 10px; padding: 8px 10px; color: var(--moyen); }

/* Connexion */
.connexion { max-width: 380px; margin: 32px auto; gap: 8px; }
.note-demo { font-size: 13px; background: #fff6d6; border: 1px solid var(--jaune); border-radius: 10px; padding: 10px 12px; }

/* Journal */
.journal { gap: 4px; }
.journal-ligne { font-size: 12px; overflow-wrap: anywhere; }

/* Message temporaire */
.message { position: fixed; z-index: 30; left: 16px; right: 16px; bottom: 76px; background: var(--marine); color: #fff; border-radius: 12px;
  padding: 12px 14px; font-size: 14px; font-weight: 600; max-width: 520px; margin: 0 auto; }
.message-erreur { background: #7a2c0a; }

/* Tablette paysage et ordinateur : menu à gauche, tickets en deux volets */
@media (min-width: 900px) {
  .menu { top: 64px; bottom: 0; right: auto; width: 190px; flex-direction: column; border-top: 0; border-right: 1px solid var(--trait); padding: 12px 0; }
  .menu-lien { flex: 0 0 auto; justify-content: flex-start; padding: 0 20px; min-height: 48px; font-size: 14px; border-top: 0;
    border-left: 4px solid transparent; }
  .menu-actif { border-left-color: var(--bleu); background: #eef6fb; }
  .connecte main { margin-left: 190px; padding: 24px 28px; }
  .volets { display: grid; grid-template-columns: 380px minmax(0, 1fr); gap: 24px; align-items: start; }
  .volets-ouvert .volet-liste, .volets:not(.volets-ouvert) .volet-detail { display: block; }
  .volet-detail .retour[href="#/tickets"] { display: none; }
  .grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); align-items: start; }
  .message { bottom: 24px; }
}

/* Ajustements après essais à l'écran */
.volet-detail > .carte { margin-bottom: 10px; }
@media (max-width: 899px) { .menu-lien { font-size: 12px; padding: 0 4px; } }
.connexion-demo { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid var(--trait); }
.note-erreur { font-size: 13px; font-weight: 600; background: #fde4d8; color: #7a2c0a; border-radius: 10px; padding: 10px 12px; }

/* Le contenu reçoit le focus à chaque changement d'écran (lecteurs d'écran) : pas de cadre jaune autour de la page entière */
main:focus, main:focus-visible { outline: none; }

/* Fixer un RDV : frise de la journée */
.trois { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 12px 0; }
.frise { position: relative; margin: 8px 0 8px 44px; background-color: #fff; border: 1px solid var(--trait); border-radius: 10px;
  background-image: repeating-linear-gradient(to bottom, transparent 0 47px, #e6ecf1 47px 48px); cursor: pointer; }
.frise-heure { position: absolute; left: -44px; width: 38px; text-align: right; font-size: 11px; font-weight: 600; color: var(--discret);
  transform: translateY(-1px); }
.frise-bloc { position: absolute; left: 6px; right: 6px; border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700;
  line-height: 1.3; overflow: hidden; pointer-events: none; }
.frise-pris { background: #dbe7f0; color: #0b2540; border: 1px solid #9db7cb; }
.frise-nouveau { background: var(--jaune); color: var(--marine); border: 2px solid var(--marine); left: 22%; }
.frise-conflit { background: #fde4d8; color: #7a2c0a; border: 2px dashed #7a2c0a; }
.frise-astreinte { left: 0; right: 0; border-radius: 0 0 10px 10px; background: #fff6d6; color: #5c4300; font-weight: 600;
  border-top: 1px dashed #b98900; }
@media (max-width: 520px) { .trois { grid-template-columns: repeat(2, minmax(0, 1fr)); } .trois > :first-child { grid-column: 1 / -1; } }
.note-ok { font-size: 13px; font-weight: 600; background: #dff3e4; color: #14532d; border-radius: 10px; padding: 10px 12px; }
