/* ============================================================================
   Portail client Smartclick — l'habillage, et rien de plus.

   ── AUCUNE VALEUR VISUELLE N'EST INVENTÉE ICI ──────────────────────────────

   Pas un hexadécimal, pas une famille de police, pas un rayon. Tout vient de
   `tokens.css`, qui est chargée AVANT ce fichier et qui arrive dans l'image au
   build, depuis `v2/public/assets/css/` — un seul fichier dans le dépôt.

   Un test le garde : `LePortailNinventeAucuneCouleurTest` refuse tout
   `#rrggbb` dans ce fichier. Si une valeur manque, elle s'ajoute à la charte
   et sert à SmartHub aussi ; elle ne se pose pas ici.

   Les pixels nus (largeurs, hauteurs de ligne, tailles de police) restent :
   ce sont des mesures, pas des teintes, et la charte ne les nomme pas toutes.
   ============================================================================ */

/* ── Le châssis ──────────────────────────────────────────────────────────── */

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; }

.mono {
  font-family: var(--font-mono);
  font-size: .8125rem;
  letter-spacing: .02em;
}

/* Le bandeau d'un compte de test. Il doit se voir sans crier : ni une erreur,
   ni un état de machine. */
.testbar {
  background: var(--test-bg);
  color: var(--paper-3);
  font-size: 13px;
  padding: 7px 20px;
}

.topbar { background: var(--blanc); border-bottom: 1px solid var(--hairline); }
.topbar-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 26px;
  min-height: 60px;
  flex-wrap: wrap;
}

.brand {
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -.015em;
  color: var(--ink);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .owl { width: 30px; height: auto; flex: none; display: block; }
.brand .wm { display: block; }
.brand i { color: var(--accent); font-style: normal; }
.brand small {
  display: block;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .13em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-top: -1px;
}

nav.main { display: flex; gap: 2px; margin-left: 8px; flex-wrap: wrap; }
nav.main a {
  padding: 8px 13px;
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-size: 14.5px;
  font-weight: 500;
}
nav.main a:hover { background: var(--paper-2); text-decoration: none; color: var(--ink); }
nav.main a.sel { background: var(--accent); color: var(--blanc); }

.who { margin-left: auto; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }

main { max-width: var(--maxw); margin: 0 auto; padding: 26px 20px 70px; }

h1 { font-size: 25px; letter-spacing: -.02em; margin: 0 0 2px; }
.sub { color: var(--ink-soft); font-size: 14px; margin: 0 0 24px; }
h2 { font-size: 15px; letter-spacing: .01em; margin: 34px 0 12px; font-weight: 600; }
h2:first-of-type { margin-top: 26px; }
.h2row { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 12px; }
.h2row h2 { margin: 0; }
.h2row .more { margin-left: auto; font-size: 13.5px; }

/* ── La pastille ─────────────────────────────────────────────────────────────
   9 px, et TOUJOURS suivie de son mot. C'est le mot qui tient l'impression en
   noir et blanc et la lecture sans distinction des couleurs — la moitié du
   raisonnement du 28/07 qu'on garde après la révision du 28/09.
   `.state` ne se coupe jamais : une pastille orpheline en fin de ligne dirait
   un état sans le nommer. */
.dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  vertical-align: -1px;
  margin-right: 6px;
  flex: none;
}
.dot.ok { background: var(--dot-ok); }
.dot.watch { background: var(--dot-watch); }
.dot.idle { background: transparent; border: 1.5px solid var(--dot-idle); }
.state { white-space: nowrap; }

/* ── Cartes-faits ────────────────────────────────────────────────────────── */
.facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 8px; }
.fact {
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  box-shadow: var(--shadow-paper);
}
.fact .lbl {
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-soft);
}
.fact .val {
  font-size: 27px; font-weight: 600; letter-spacing: -.02em;
  margin-top: 5px; line-height: 1.1;
}
.fact .val small { font-size: 15px; font-weight: 500; color: var(--ink-soft); }
.fact .hint { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; }

/* ── Fiche société ───────────────────────────────────────────────────────── */
.ident {
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px 22px;
  margin-bottom: 18px;
}
.ident div { min-width: 0; }
.ident dt {
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-soft);
}
.ident dd { margin: 2px 0 0; font-size: 14.5px; }
.ident .name { font-size: 18px; font-weight: 600; letter-spacing: -.01em; }

/* ── Tableaux ────────────────────────────────────────────────────────────── */
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
th {
  text-align: left;
  font-size: 11.5px; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--ink-soft);
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline);
  white-space: nowrap;
  background: var(--paper-3);
}
td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--paper-2);
  font-size: 14.5px;
  vertical-align: top;
}
tr:last-child td { border-bottom: 0; }
tbody tr.clickable:hover { background: var(--accent-tint); cursor: pointer; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { border-top: 1px solid var(--hairline); border-bottom: 0; font-weight: 600; background: var(--paper-3); }
.ref { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.obj { font-weight: 500; }
.offert { color: var(--accent); font-weight: 600; }
.dim { color: var(--ink-soft); }

/* Un tableau peut défiler dans SON cadre ; la page, jamais. */
.tablewrap { overflow-x: auto; }

/* ── Cartes machine ──────────────────────────────────────────────────────── */
.grid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card {
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: var(--shadow-paper);
}
.card .hd { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 3px; }
.card .hd h3 { margin: 0; font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.card .hd .ref { margin-left: auto; padding-top: 3px; }
.card .meta { color: var(--ink-soft); font-size: 13.5px; margin-bottom: 12px; }
.rows { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 14px; align-items: baseline; }
.rows dt { color: var(--ink-soft); }
.rows dd { margin: 0; text-align: right; }
.cardft {
  margin-top: 14px; padding-top: 13px;
  border-top: 1px solid var(--paper-2);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}

/* La barre de disque. Le pourcentage est écrit à côté : la barre seule ne dit
   rien, et une barre sans chiffre ne s'imprime pas. */
.bar {
  display: inline-block;
  width: 104px; height: 6px;
  background: var(--paper-2);
  border-radius: 3px;
  overflow: hidden;
  vertical-align: 0;
  margin-right: 8px;
}
.bar i { display: block; height: 100%; background: var(--accent); }
.bar.hot i { background: var(--dot-watch); }

/* ── Boutons ─────────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--blanc);
  border-radius: var(--radius);
  padding: 8px 15px;
  font: inherit; font-size: 14px; font-weight: 500;
  cursor: pointer; text-decoration: none;
}
.btn:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: var(--blanc);
  text-decoration: none;
}
.btn.ghost { background: transparent; color: var(--accent); }
.btn.ghost:hover { background: var(--accent-tint); color: var(--accent-strong); }
.btn.ghost[disabled], .btn.ghost.off {
  color: var(--ink-soft);
  border-color: var(--hairline);
  background: transparent;
  cursor: not-allowed;
}
.btn.sm { padding: 5px 11px; font-size: 13.5px; }

/* ── Onglets de filtre ───────────────────────────────────────────────────── */
.filters { display: flex; gap: 4px; border-bottom: 1px solid var(--hairline); margin-bottom: 0; flex-wrap: wrap; }
.filters a {
  padding: 8px 13px; font-size: 14px; color: var(--ink-soft);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.filters a:hover { color: var(--ink); text-decoration: none; }
.filters a.sel { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.filters .n { color: var(--ink-soft); font-weight: 400; font-size: 13px; }

/* ── Fil de demande ──────────────────────────────────────────────────────── */
.thread { display: flex; flex-direction: column; gap: 14px; }
.msg {
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 13px 16px;
  background: var(--blanc);
  /* Un paragraphe sur 1120 px ne se lit pas. */
  max-width: min(100%, 760px);
}
.msg.us { background: var(--accent-tint); border-color: var(--accent-border); align-self: flex-start; }
.msg.you { align-self: flex-end; }
.msg .mh { font-size: 12.5px; color: var(--ink-soft); margin-bottom: 5px; display: flex; gap: 10px; }
.msg .mh b { color: var(--ink); font-weight: 600; }
.msg p { margin: 0; }
.evt { font-size: 13px; color: var(--ink-soft); padding-left: 2px; }
.evt .dot { vertical-align: 0; }
.reply {
  margin-top: 20px;
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}

/* ── Formulaires ─────────────────────────────────────────────────────────── */
label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-bottom: 5px; }
textarea, input[type=text], input[type=email], input[type=password], select {
  width: 100%;
  font: inherit; font-size: 14.5px;
  padding: 9px 11px;
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  background: var(--blanc);
  color: var(--ink);
}
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--accent-border);
  outline-offset: -1px;
  border-color: var(--accent);
}
.field { margin-bottom: 16px; }
.help { font-size: 12.5px; color: var(--ink-soft); margin-top: 5px; }
.colonne { max-width: 720px; }

/* ── Le bandeau d'explication — jamais une alerte ────────────────────────── */
.tell {
  background: var(--accent-tint);
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-lg);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 18px;
}
.tell b { font-weight: 600; }

/* Le seul emploi de --err : une erreur de SAISIE dans un formulaire. Jamais un
   état de machine — le portail montre des faits, pas des alarmes (D-6). */
.erreur {
  background: var(--blanc);
  border: 1px solid var(--err);
  border-left-width: 3px;
  border-radius: var(--radius);
  color: var(--err);
  padding: 10px 14px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* ── Connexion ───────────────────────────────────────────────────────────── */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login { width: 100%; max-width: 384px; }
.login .brand {
  flex-direction: column; align-items: center; gap: 14px;
  font-size: 26px; margin-bottom: 6px; text-align: center;
}
.login .brand .owl { width: 58px; }
.login .brand small { letter-spacing: .14em; font-size: 10.5px; }
.login .box {
  background: var(--blanc);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 22px;
  box-shadow: var(--shadow-paper);
}
.login h1 { font-size: 18px; margin-bottom: 20px; text-align: center; }
.login .btn { width: 100%; text-align: center; padding: 11px; }
.login .foot { text-align: center; font-size: 12.5px; color: var(--ink-soft); margin-top: 18px; line-height: 1.7; }

/* ── Pied ────────────────────────────────────────────────────────────────── */
footer.pf {
  border-top: 1px solid var(--hairline);
  margin-top: 40px; padding-top: 16px;
  font-size: 12.5px; color: var(--ink-soft);
  display: flex; gap: 18px; flex-wrap: wrap;
}

/* ── Étroit ──────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .facts { grid-template-columns: repeat(2, 1fr); }
  .ident { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .topbar-in { min-height: 0; padding-top: 10px; padding-bottom: 10px; }
  .who { margin-left: 0; width: 100%; }
  /* Le tableau défile dans son cadre. La page, jamais. */
  .tablewrap { overflow-x: auto; }
  table { min-width: 620px; }
}
