/* Portail soumissions — style visuel du POC / de la fiche d'analyser.py
 * (constantes STYLE/BADGES), monté dans la coquille à onglets du patron
 * rh/web (auth, entête, onglets). */
:root {
  --encre: #1a1c1e; --sourdine: #5b6168; --trait: #d8dbdf;
  --fond: #ffffff; --fond2: #f6f7f8;
  --ok: #1e7d43; --exclu: #a33b3b; --ambigu: #a3720e; --silence: #6b7280;
  --accent: #143d59; --accent-clair: #e8eef5;
  --rouge: #b91c1c;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding: 0; background: var(--fond); color: var(--encre);
       font: 16px/1.6 Georgia, 'Times New Roman', serif; }

/* ---- Entête + onglets (coquille rh/web) -------------------------------- */
header { background: var(--accent); color: #fff; padding: 1rem 1.5rem 0;
         font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
header h1 { margin: 0 0 .25rem; font-size: 1.4rem; }
.sous-titre { margin: 0 0 .5rem; font-size: .85rem; opacity: .85; }
.entete-haut { display: flex; justify-content: space-between;
  align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.entete-compte { display: flex; align-items: center; gap: .6rem; }
.utilisateur { font-size: .82rem; opacity: .9; }
button { padding: .5rem .9rem; border: 1px solid var(--trait); border-radius: 6px;
  background: #fff; cursor: pointer; font-size: .9rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
button.primaire { background: var(--accent); color: #fff;
  border-color: var(--accent); }
button:hover { filter: brightness(.97); }
button.btn-fiche { padding: .3rem .8rem; font-size: .85rem;
  white-space: nowrap; }
button.lien { background: none; border: none; color: var(--accent);
  cursor: pointer; text-decoration: underline; padding: 0; font-size: .85rem; }
.deconnexion { background: rgba(255,255,255,.15); color: #fff;
  border-color: rgba(255,255,255,.4); }
.deconnexion:hover { background: rgba(255,255,255,.25); }
.onglets { display: flex; gap: .25rem; margin-top: .75rem; }
.onglet { background: rgba(255,255,255,.12); color: #fff; border: none;
  border-radius: 8px 8px 0 0; padding: .5rem .9rem; cursor: pointer;
  font-size: .9rem; }
.onglet.actif { background: var(--fond); color: var(--accent); font-weight: 600; }

main { padding: 1.5rem; max-width: 1100px; margin: 0 auto; }

/* ---- Écran de connexion (Supabase Auth, patron rh/web) ----------------- */
.vue-auth { min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 1.5rem; background: var(--accent-clair);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.carte-auth { background: #fff; border: 1px solid var(--trait);
  border-radius: 12px; padding: 1.75rem; width: min(380px, 92vw);
  box-shadow: 0 10px 40px rgba(0,0,0,.08); display: grid; gap: .75rem; }
.carte-auth h1 { margin: 0; color: var(--accent); font-size: 1.4rem; }
.sous-titre-auth { margin: 0 0 .5rem; color: var(--sourdine); font-size: .85rem; }
.carte-auth label { display: grid; gap: .25rem; font-size: .8rem;
  color: var(--sourdine); }
input { padding: .45rem .55rem; border: 1px solid var(--trait);
  border-radius: 6px; font-size: .9rem; background: #fff; }
.actions-auth { display: grid; gap: .5rem; margin-top: .5rem; }
.actions-auth button { width: 100%; }
.message { padding: .6rem .8rem; border-radius: 6px; background: #fef9c3;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: .88rem; }
.message.erreur, .erreur { color: var(--rouge); }

/* ---- Contenu : style de la fiche d'analyser.py (STYLE) ----------------- */
h2 { font-size: 1.45rem; color: var(--accent); margin: 2rem 0 1rem;
     padding-top: 1.2rem; border-top: 1px solid var(--trait); }
.vue-onglet > h2:first-child, .page-fiche > h2:first-child {
  border-top: none; padding-top: 0; margin-top: .5rem; }
h3 { font-size: 1.12rem; margin: 1.8rem 0 .6rem; }
p { margin: .6rem 0; }
.avis { background: var(--fond2); border-left: 4px solid var(--accent);
        padding: .8rem 1.1rem; margin: 1.2rem 0; font-size: .95rem; }
.avis.cle { border-left-color: var(--ok); }
table { border-collapse: collapse; width: 100%; margin: 1rem 0;
        font-size: .92rem; }
th, td { border: 1px solid var(--trait); padding: .45rem .65rem;
         text-align: left; vertical-align: top; }
th { background: var(--fond2); font-weight: 600; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums;
             white-space: nowrap; }
.v { display: inline-block; padding: .05rem .5rem; border-radius: 3px;
     font-size: .8rem; font-family: ui-monospace, Consolas, monospace;
     white-space: nowrap; }
.v.inclus { background: #e5f3ea; color: var(--ok); }
.v.exclu { background: #f7e7e7; color: var(--exclu); }
.v.ambigu { background: #f7efdd; color: var(--ambigu); }
.v.silence { background: #eceef1; color: var(--silence); }
.anomalie { background: #fdf3f3; }
.cit { font-size: .86rem; color: var(--sourdine); font-style: italic; }
.corr { font-size: .8rem; color: var(--ambigu);
        font-family: ui-monospace, Consolas, monospace; }
.chiffre-cle { display: flex; gap: 1rem; flex-wrap: wrap; margin: 1.4rem 0; }
.chiffre-cle > div { flex: 1 1 130px; background: var(--fond2);
                     border: 1px solid var(--trait); padding: .9rem 1rem;
                     text-align: center; }
.chiffre-cle .gros { font-size: 1.6rem; font-weight: 700;
                     color: var(--accent); display: block; }
.chiffre-cle .lbl { font-size: .8rem; color: var(--sourdine); }
code { background: var(--fond2); padding: .1rem .35rem; font-size: .85em;
       font-family: ui-monospace, Consolas, monospace; }
.tbl-scroll { overflow-x: auto; }
footer { margin-top: 4rem; padding-top: 1rem;
         border-top: 1px solid var(--trait); color: var(--sourdine);
         font-size: .85rem; }
a { color: var(--accent); }

/* ---- Fiche : entête de document (gabarit d'analyser.py) ---------------- */
.barre { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap;
  margin-bottom: 1rem; }
.page-fiche header.titre { background: none; color: var(--encre); padding: 0;
  border-bottom: 3px solid var(--accent); padding-bottom: 1.2rem;
  margin-bottom: 2rem; font-family: Georgia, 'Times New Roman', serif; }
.page-fiche header.titre h1 { font-size: 1.7rem; line-height: 1.25;
  margin: 0 0 .4rem; color: var(--accent); overflow-wrap: anywhere; }
.page-fiche header.titre .sous { color: var(--sourdine); font-size: .95rem; }

/* ---- Matrice : cellules compactes, en-têtes verticaux (POC) ------------ */
.matrice td, .matrice th { padding: .15rem .3rem; }
.matrice td.c { text-align: center;
  font-family: ui-monospace, Consolas, monospace; font-size: .78rem;
  cursor: default; }
.matrice th.doc { writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: .72rem; font-weight: 400; white-space: nowrap;
  max-height: 19rem; vertical-align: bottom; cursor: pointer; }
.matrice th.doc:hover { background: var(--accent-clair); }
.matrice th.doc .fichier { font-size: .66rem; font-weight: 400;
  font-style: italic; color: var(--sourdine); }
.matrice td.c.inclus  { background: #e5f3ea; color: var(--ok); }
.matrice td.c.exclu   { background: #f7e7e7; color: var(--exclu); }
.matrice td.c.ambigu  { background: #f7efdd; color: var(--ambigu); }
.matrice td.c.silence { color: var(--sourdine); }
.matrice tr.categorie td { background: var(--fond2); font-weight: 600;
  font-size: .85rem; }
.matrice td.el { white-space: nowrap; max-width: 18rem; overflow: hidden;
  text-overflow: ellipsis; font-size: .85rem; }
.legende span { margin-right: 1.2rem; }

@media print { main { max-width: none; padding: 0; }
               header, .barre, .onglets { display: none; }
               h2, h3 { break-after: avoid; }
               table, .avis { break-inside: avoid; } }
