/* Feuille de style unique de l'application. Aucune ressource externe.
   Fichier servi publiquement : n'y mettre aucune information sur le contenu. */

:root {
  --texte: #1d2126;
  --gris: #6a7480;
  --trait: #dfe3e8;
  --fond: #f6f7f9;
  --blanc: #fff;
  --accent: #1f5fa8;
  --accent-clair: #eaf1fa;
  --note: #fdf6dd;
  --note-trait: #e4d28a;
  --appel: #eef6ee;
  --appel-trait: #b9d7b9;
  --transcript: #f1f0f7;
  --transcript-trait: #c8c4de;
  --alerte: #a10000;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--texte);
  background: var(--fond);
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

main {
  max-width: 78rem;
  margin: 0 auto;
  padding: 1.2rem 1.2rem 3rem;
}

h1 { font-size: 1.35rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.05rem; margin: 1.6rem 0 .6rem; }

.meta { color: var(--gris); font-size: .88em; }

/* ---------------------------------------------------------------- bandeau */
.bandeau {
  background: var(--blanc);
  border-bottom: 1px solid var(--trait);
}
.bandeau-in {
  max-width: 78rem;
  margin: 0 auto;
  padding: .55rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.marque { font-weight: 600; text-decoration: none; color: var(--texte); white-space: nowrap; }
.retour { text-decoration: none; color: var(--gris); font-size: .9em; white-space: nowrap; }
.retour:hover { color: var(--accent); }
.bandeau-recherche { flex: 1 1 22rem; display: flex; gap: .4rem; }
.bandeau-recherche input { flex: 1; }
.bandeau-user { display: flex; align-items: center; gap: .6rem; color: var(--gris); font-size: .9em; }
.bandeau-user form { margin: 0; }

button, .bandeau-recherche button {
  font: inherit;
  padding: .35rem .8rem;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 4px;
  cursor: pointer;
}
button:hover { background: #17497f; }
button.lien {
  background: none; border: none; color: var(--accent);
  padding: 0; text-decoration: underline; cursor: pointer;
}
button.lien:hover { background: none; color: #17497f; }

input[type=text], input[type=password], input[type=search], input[type=date], select {
  font: inherit;
  padding: .35rem .5rem;
  border: 1px solid #bfc6ce;
  border-radius: 4px;
  background: #fff;
  color: inherit;
  min-width: 0;
}
input:focus, select:focus, button:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.rappel {
  max-width: 78rem;
  margin: .7rem auto -.3rem;
  padding: .35rem 1.2rem;
  color: var(--gris);
  font-size: .85em;
}

footer {
  border-top: 1px solid var(--trait);
  color: var(--gris);
  font-size: .85em;
  text-align: center;
  padding: 1rem;
}

.fil { color: var(--gris); font-size: .9em; margin: 0 0 .6rem; }

/* --------------------------------------------------------------- connexion */
.page-login main { max-width: 26rem; }
.login {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: 1.6rem;
  margin-top: 3rem;
}
.login h1 { margin-top: 0; }
.login .intro { color: var(--gris); font-size: .92em; }
.login label { display: block; margin: .9rem 0 .25rem; font-weight: 600; font-size: .9em; }
.login input { width: 100%; }
.login button { width: 100%; margin-top: 1.2rem; padding: .5rem; }
.login .aide { margin-top: 1.2rem; font-size: .85em; color: var(--gris); }

.erreur {
  background: #fdecec; border: 1px solid #e8b4b4; color: var(--alerte);
  padding: .55rem .8rem; border-radius: 4px; font-size: .92em;
}
.info {
  background: var(--accent-clair); border: 1px solid #b9cfe8;
  padding: .55rem .8rem; border-radius: 4px; font-size: .92em;
}

/* --------------------------------------------------------------- recherche */
.recherche {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: 6px;
  padding: .9rem 1rem;
}
.ligne-q { display: flex; gap: .5rem; }
.ligne-q input { flex: 1; font-size: 1.02rem; padding: .45rem .6rem; }

.filtres { margin-top: .7rem; }
.filtres summary { cursor: pointer; color: var(--accent); font-size: .92em; }
.filtres-grille {
  display: flex; flex-wrap: wrap; gap: .7rem 1.2rem; align-items: end;
  margin-top: .7rem; font-size: .92em;
}
.filtres-grille label { display: flex; flex-direction: column; gap: .2rem; color: var(--gris); }
.filtres-grille label.case { flex-direction: row; align-items: center; gap: .35rem; color: inherit; }
.filtres-actions { margin-left: auto; font-size: .92em; }

.clientes { margin-top: 1.4rem; }
.liste-clientes { list-style: none; padding: 0; margin: 0; }
.liste-clientes li {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-left: 3px solid var(--accent);
  border-radius: 4px;
  padding: .5rem .8rem;
  margin-bottom: .4rem;
  display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline;
}
.liste-clientes a { font-weight: 600; }

.vide { color: var(--gris); }

/* ------------------------------------------------------------ liste tickets */
table.tickets {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-radius: 6px;
  overflow: hidden;
  font-size: .93em;
}
table.tickets th {
  text-align: left; font-weight: 600; font-size: .85em; color: var(--gris);
  padding: .5rem .7rem; border-bottom: 1px solid var(--trait); white-space: nowrap;
}
table.tickets td { padding: .5rem .7rem; border-bottom: 1px solid #eef0f3; vertical-align: top; }
table.tickets tr:last-child td { border-bottom: none; }
table.tickets tr:hover td { background: #fafbfc; }
td.date, td.num { white-space: nowrap; color: var(--gris); }
td.num a { font-variant-numeric: tabular-nums; }
td.sujet { width: 42%; }
td.sujet a { font-weight: 600; text-decoration: none; }
td.sujet a:hover { text-decoration: underline; }
td.pj { white-space: nowrap; color: var(--gris); }
.extrait { margin: .25rem 0 0; color: var(--gris); font-size: .93em; }
.c-msg { white-space: nowrap; }
.c-pj { white-space: nowrap; margin-left: .35rem; cursor: help; }
.c-pj.off { opacity: .45; }
mark { background: #fff2a8; padding: 0 .1em; }

.statut { font-size: .8em; padding: .1rem .45rem; border-radius: 10px; white-space: nowrap; }
.st-clos { background: #eceef1; color: #5a6470; }
.st-resolu { background: #e6f3ea; color: #26663c; }
.st-nouveau { background: #e7eefb; color: #1f5fa8; }
.st-ouvert { background: #fdeee0; color: #96551a; }
.st-attente { background: #fdf6dd; color: #7a6415; }
.st-autre { background: #eceef1; color: #5a6470; }

.pagination { display: flex; gap: 1rem; align-items: center; justify-content: center; margin: 1rem 0; }
.pagination .pos { color: var(--gris); font-size: .9em; }
.pagination .off { color: #b6bcc4; }

/* ------------------------------------------------------------ fiche cliente */
.titre-cliente { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.badge-sys {
  font-size: .62em; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  background: #fdeee0; color: #96551a; padding: .15rem .5rem; border-radius: 3px;
}
dl.fiche, dl.ticket-meta {
  display: flex; flex-wrap: wrap; gap: .1rem 2rem;
  background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px;
  padding: .8rem 1rem; margin: 0 0 1rem;
}
dl.fiche > div, dl.ticket-meta > div { min-width: 11rem; padding: .2rem 0; }
dl.fiche dt, dl.ticket-meta dt {
  font-size: .78em; text-transform: uppercase; letter-spacing: .03em; color: var(--gris);
}
dl.fiche dd, dl.ticket-meta dd { margin: 0; }

/* ------------------------------------------------------------------ ticket */
.ticket-tete h1 { margin-bottom: .8rem; }
.tags .tag {
  display: inline-block; background: var(--fond); border: 1px solid var(--trait);
  border-radius: 3px; padding: 0 .35rem; font-size: .85em; margin-right: .2rem;
}

ol.fil-messages { list-style: none; padding: 0; margin: 0; }
.msg {
  background: var(--blanc);
  border: 1px solid var(--trait);
  border-left: 4px solid var(--trait);
  border-radius: 6px;
  padding: .7rem 1rem .8rem;
  margin-bottom: .7rem;
}
.msg-public { border-left-color: var(--accent); }
.msg-note { background: var(--note); border-color: var(--note-trait); border-left-color: var(--note-trait); }
.msg-call { background: var(--appel); border-color: var(--appel-trait); border-left-color: var(--appel-trait); }
.msg-transcript { background: var(--transcript); border-color: var(--transcript-trait); border-left-color: var(--transcript-trait); }

.msg-tete { display: flex; gap: .7rem; align-items: baseline; flex-wrap: wrap; margin-bottom: .4rem; }
.msg-auteur { font-weight: 600; }
.msg-type {
  font-size: .72em; text-transform: uppercase; letter-spacing: .05em; font-weight: 600;
  color: #7a6415; background: rgba(0, 0, 0, .05); padding: .1rem .45rem; border-radius: 3px;
}
.msg-call .msg-type { color: #26663c; }
.msg-transcript .msg-type { color: #45408a; }
.msg-tete time { color: var(--gris); font-size: .85em; margin-left: auto; }

.msg-corps { white-space: normal; word-wrap: break-word; overflow-wrap: anywhere; }
.msg-corps a { word-break: break-all; }

button.plus {
  margin-top: .5rem; background: none; border: 1px solid #bfc6ce; color: var(--accent);
  font-size: .85em; padding: .2rem .6rem;
}
button.plus:hover { background: var(--accent-clair); }

ul.pieces { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-wrap: wrap; gap: .8rem; }
ul.pieces li {
  display: flex; flex-direction: column; gap: .2rem; align-items: flex-start;
  max-width: 15rem; font-size: .88em;
}
ul.pieces li.pj-non { color: var(--gris); font-style: italic; }
.vignette {
  max-width: 14rem; max-height: 10rem; border: 1px solid var(--trait);
  border-radius: 4px; background: #fff; display: block;
}
.pj-nom { word-break: break-all; }
.pj-lien { text-decoration: none; font-weight: 600; }
.pj-dl { font-size: .85em; }

.voisins {
  display: flex; gap: 1rem; align-items: center; justify-content: space-between;
  flex-wrap: wrap; margin-top: 1.2rem; font-size: .92em;
}
.voisins .off { color: #b6bcc4; }
.voisins .fiche-lien { margin: 0 auto; }

/* ---------------------------------------------------------- petits écrans */
@media (max-width: 800px) {
  .bandeau-recherche { order: 3; flex-basis: 100%; }
  table.tickets { font-size: .88em; }
  td.cliente, th:nth-child(4), td:nth-child(5), th:nth-child(5) { display: none; }
  .msg-tete time { margin-left: 0; }
}

/* ------------------------------------------------------- gestion des comptes */
.ligne-compte { display: inline-flex; gap: .3rem; align-items: center; flex-wrap: wrap; margin: 0 0 .25rem; }
button.mini { font-size: .82em; padding: .18rem .5rem; }
button.mini.danger { background: #fff; color: var(--alerte); border-color: #e8b4b4; }
button.mini.danger:hover { background: var(--alerte); color: #fff; }
.ajout { display: flex; flex-wrap: wrap; gap: .6rem 1rem; align-items: end;
         background: var(--blanc); border: 1px solid var(--trait); border-radius: 6px;
         padding: .9rem 1rem; }
.ajout label { display: flex; flex-direction: column; gap: .2rem; font-size: .88em; color: var(--gris); }
.mdp-neuf { background: #e8f6ec; border: 1px solid #0a6b2d; border-radius: 6px;
            padding: .8rem 1rem; margin: 1rem 0; }
.mdp-neuf p { margin: .2rem 0; }
.mdp-neuf .mdp { font-family: ui-monospace, Consolas, monospace; font-size: 1.25rem;
                 font-weight: 700; letter-spacing: .02em; user-select: all; }
