/* Portail client Espace Informatique
 *
 * Direction : la barre latérale prolonge le panneau bleu de la connexion ; une seule famille
 * (Instrument Sans) dont la largeur condensée sert aux titres, comme une étiquette d'inventaire ;
 * tous les statuts sont des voyants, comme les LED d'un switch.
 */

:root {
  --blue: #0a6fb0;
  --blue-hover: #08609a;
  --night: #06375a;
  --mist: #edf2f6;
  --paper: #ffffff;
  --ink: #13283a;
  --slate: #5b6e80;
  --faint: #8798a8;
  --line: #d7e0e8;
  --line-soft: #e8eef3;
  --tint: #f5f8fb;

  --led-ok: #1fa45b;
  --led-warn: #e3a008;
  --led-danger: #d9443b;
  --led-info: #2f95dc;
  --led-neutral: #7c8fa3;
  --led-off: #bac6d1;

  --text-danger: #b3261e;
  --text-ok: #17713f;

  --font: "Instrument Sans Variable", "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --narrow: 78%;
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--mist);
  font-variant-numeric: tabular-nums;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { margin: 0; font-stretch: var(--narrow); font-variation-settings: "wdth" 78; font-weight: 650; letter-spacing: -0.005em; line-height: 1.15; }
p { margin: 0 0 12px; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--slate); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row form { margin: 0; }
.spacer { flex: 1; }
.body-pre { white-space: pre-wrap; overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- Voyants et étiquettes */

.badge {
  --led: var(--led-neutral);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.3;
}
.badge::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--led);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--led) 20%, transparent);
}
.badge.ok { --led: var(--led-ok); }
.badge.warn { --led: var(--led-warn); }
.badge.danger { --led: var(--led-danger); }
.badge.info { --led: var(--led-info); }
.badge.neutral { --led: var(--led-neutral); }
.badge.muted { --led: var(--led-off); color: var(--slate); }
.badge.muted::before { box-shadow: none; }
/* Action attendue du client : voyant qui clignote comme une activité réseau. */
.badge.action { --led: var(--led-warn); font-weight: 650; }
.badge.action::before { animation: led-blink 1.6s steps(1, end) infinite; }
@keyframes led-blink { 0%, 70% { opacity: 1; } 70.01%, 100% { opacity: .25; } }
@media (prefers-reduced-motion: reduce) { .badge.action::before { animation: none; } }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: 1px; }
.dot.warn { background: var(--led-warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led-warn) 20%, transparent); }
.dot.danger { background: var(--led-danger); box-shadow: 0 0 0 3px color-mix(in srgb, var(--led-danger) 20%, transparent); }

/* Référence au format étiquette d'inventaire */
.tag {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  font-stretch: var(--narrow); font-variation-settings: "wdth" 78;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 5px 8px 5px 14px;
  color: var(--night);
  background: var(--tint) radial-gradient(circle at 6px 50%, var(--line) 0 2px, transparent 2.5px) no-repeat;
  border: 1px solid var(--line);
  border-radius: 4px;
  white-space: nowrap;
}
.tag a { color: inherit; }
h1 .tag { font-size: 0.55em; vertical-align: middle; margin-left: 6px; }

/* ---------------------------------------------------------------- Connexion */

.auth {
  display: grid;
  grid-template-columns: minmax(0, 44fr) minmax(0, 56fr);
  min-height: 100vh;
  background: var(--paper);
}
.auth-brand {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 56px 64px 48px;
  background: var(--blue);
  color: #fff;
  overflow: hidden;
}
.auth-brand .brand-logo { width: 48px; height: 48px; }
.auth-brand .wordmark { display: flex; align-items: center; gap: 14px; margin: 0; font-size: 22px; font-weight: 650; font-stretch: 75%; font-variation-settings: "wdth" 75; letter-spacing: 0.005em; }
.auth-brand .claim {
  margin: auto 0 0;
  max-width: 11ch;
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 650;
  font-stretch: 75%; font-variation-settings: "wdth" 75;
  line-height: 0.98;
  letter-spacing: -0.015em;
}
.auth-brand .claim-sub {
  margin: 22px 0 0;
  max-width: 34ch;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.82);
}
.auth-brand .contact {
  margin: 28px 0 40px;
  display: flex;
  gap: 8px 28px;
  flex-wrap: wrap;
  font-size: 14.5px;
}
.auth-brand .contact a { color: #fff; font-weight: 600; }
.auth-brand .contact span { display: block; font-size: 12.5px; color: rgba(255, 255, 255, 0.68); font-weight: 400; }
.auth-brand footer {
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.75);
}
.auth-brand footer strong { color: #fff; font-weight: 600; }

/* Façade de switch : 2 × 12 ports, voyants d'activité */
.faceplate { display: block; width: 100%; max-width: 440px; height: auto; margin-bottom: 28px; }
.faceplate .plate { fill: rgba(255, 255, 255, 0.07); stroke: rgba(255, 255, 255, 0.22); }
.faceplate .port { fill: rgba(3, 30, 52, 0.55); stroke: rgba(255, 255, 255, 0.28); }
.faceplate .led { fill: rgba(255, 255, 255, 0.18); }
.faceplate .led.on { fill: #4fe08b; }
.faceplate .led.amber { fill: #ffc53d; }
.faceplate .led.blink { animation: blink 1.6s steps(2, jump-none) infinite; }
@keyframes blink { 50% { fill: rgba(255, 255, 255, 0.18); } }
@media (prefers-reduced-motion: reduce) { .faceplate .led.blink { animation: none; } }

.auth-main { display: flex; flex-direction: column; padding: 48px 72px 36px; }
.auth-form { margin: auto 0; width: 100%; max-width: 392px; }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--blue); margin-bottom: 6px; }
.auth-form h1 { font-size: 40px; font-stretch: 75%; font-variation-settings: "wdth" 75; margin-bottom: 10px; }
.auth-form .lede { color: var(--slate); margin-bottom: 32px; max-width: 34ch; }
.auth-form .label-row { display: flex; justify-content: space-between; align-items: baseline; }
.auth-form .label-row a { font-size: 13.5px; }
.auth-form .btn { width: 100%; height: 48px; font-size: 16px; margin-top: 6px; }
.auth-form .dl { margin-bottom: 20px; }
.auth-main footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--slate);
}

@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 24px; }
  .auth-brand .wordmark { font-size: 19px; }
  .auth-brand .claim { margin-top: 28px; font-size: 42px; max-width: 14ch; }
  .auth-brand .claim-sub, .faceplate, .auth-brand footer { display: none; }
  .auth-brand .contact { margin: 18px 0 0; }
  .auth-main { padding: 32px 20px 20px; }
  .auth-form { margin: 0 0 40px; }
}

/* ---------------------------------------------------------------- Formulaires */

.field { display: block; margin-bottom: 18px; }
.field > span, .label-row > label, .field-label {
  display: block;
  font-size: 14px;
  font-weight: 550;
  margin-bottom: 6px;
}
.field > span .muted { font-weight: 400; }
.field .hint { display: block; font-size: 13px; color: var(--slate); margin-top: 6px; font-weight: 400; }
input[type="text"], input[type="email"], input[type="password"], input[type="tel"], input[type="date"],
input[type="number"], input[type="search"], input[type="file"], select, textarea {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid #c6d3de;
  border-radius: var(--r);
  padding: 9px 12px;
  min-height: 42px;
  transition: border-color 0.12s, box-shadow 0.12s;
}
input:disabled { background: var(--tint); color: var(--slate); }
.auth-form input { min-height: 48px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input::placeholder, textarea::placeholder { color: #9aa9b7; }
input:hover:not(:disabled), select:hover, textarea:hover { border-color: #a9bccb; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(10, 111, 176, 0.16);
}
input[type="number"] { max-width: 110px; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--ink); margin: 4px 0 20px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--blue); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 18px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 18px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.form-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
select.auto-width { width: auto; }
.row .check { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: var(--r);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--paper); color: var(--ink); border-color: #c6d3de; }
.btn.secondary:hover { border-color: var(--blue); color: var(--blue); }
.btn.danger { background: var(--paper); color: var(--text-danger); border-color: #ecc2be; }
.btn.danger:hover { background: #fdf1f0; }
.btn.small { min-height: 34px; padding: 0 12px; font-size: 14px; }
.linkbtn { background: none; border: 0; padding: 0; font: inherit; color: var(--blue); cursor: pointer; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
form.inline { display: inline; }

.alert {
  display: flex;
  gap: 10px;
  align-items: baseline;
  border-radius: var(--r);
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14.5px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.alert::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; transform: translateY(-1px); }
.alert.error { border-color: #f0c6c2; background: #fdf3f2; color: var(--text-danger); }
.alert.error::before { background: var(--led-danger); }
.alert.ok { border-color: #bfe3cc; background: #f1faf4; color: var(--text-ok); }
.alert.ok::before { background: var(--led-ok); }
.alert.info { border-color: #c4dcef; background: #f2f8fc; color: var(--night); display: block; }
.alert.info::before { display: none; }
/* Le support attend une réponse du client. */
.alert.waiting { align-items: center; border-color: #f1d79a; background: #fff8e6; color: #5f4300; }
.alert.waiting::before { background: var(--led-warn); align-self: center; animation: led-blink 1.6s steps(1, end) infinite; }
.alert.waiting > div { flex: 1; }
.alert.waiting .btn { flex: none; }
@media (prefers-reduced-motion: reduce) { .alert.waiting::before { animation: none; } }

/* ---------------------------------------------------------------- Captures d'écran */

kbd {
  font: inherit; font-size: 12px; font-weight: 600; line-height: 1;
  padding: 2px 5px; border: 1px solid #c6d3de; border-bottom-width: 2px; border-radius: 4px; background: var(--paper); color: var(--ink);
}
.captures-drop {
  position: relative; display: block; padding: 14px 16px; cursor: pointer;
  border: 1px dashed #b3c4d2; border-radius: var(--r); background: var(--tint);
  transition: border-color 0.12s, background-color 0.12s;
}
.captures-drop:hover, .captures-field.dragging .captures-drop { border-color: var(--blue); background: #eef5fb; }
.captures-drop:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 111, 176, 0.16); }
.captures-drop input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; min-height: 0; }
.captures-cta { display: block; font-size: 14.5px; font-weight: 400; color: var(--ink); }
.captures-cta strong { color: var(--blue); font-weight: 600; }
.captures-field .hint { line-height: 1.7; }
.captures-preview { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.captures-preview:not(:empty) { margin-top: 10px; }
.captures-preview li {
  position: relative; width: 112px; border: 1px solid var(--line); border-radius: var(--r); background: var(--paper); overflow: hidden;
}
.captures-preview img { display: block; width: 100%; height: 72px; object-fit: cover; background: var(--tint); }
.captures-preview .name { display: block; padding: 4px 6px; font-size: 12px; color: var(--slate); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.captures-preview button {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(14, 33, 51, 0.78); color: #fff; font-size: 16px; line-height: 24px; cursor: pointer;
}
.captures-preview button:hover, .captures-preview button:focus-visible { background: var(--text-danger); outline: none; }
.captures-error { margin: 8px 0 0; font-size: 13.5px; color: var(--text-danger); }

/* Vignettes dans la conversation : on clique pour ouvrir l'image en grand. */
.captures { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.captures a { display: block; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--paper); line-height: 0; }
.captures a:hover, .captures a:focus-visible { border-color: var(--blue); }
.captures img { display: block; width: auto; height: auto; max-width: min(260px, 100%); max-height: 170px; }

/* ---------------------------------------------------------------- Cadre de l'application */

.app { display: grid; grid-template-columns: 252px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 22px 14px 18px;
  background: var(--blue);
  color: #fff;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 8px 26px; color: #fff; }
.brand:hover { text-decoration: none; }
/* Logo EI (fichier d'origine, non modifié) : cadre rond pour masquer le fond blanc autour du disque. */
.brand-logo {
  flex: none; display: block; width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: #fff;
}

.brand strong { display: block; font-size: 21px; margin-bottom: 3px; font-weight: 650; font-stretch: var(--narrow); font-variation-settings: "wdth" 78; line-height: 1.15; }
.brand span span { display: block; font-size: 13px; color: rgba(255, 255, 255, 0.72); line-height: 1.3; }
.nav-label { font-size: 13px; color: rgba(255, 255, 255, 0.6); padding: 18px 12px 6px; }
.nav-label:first-child { padding-top: 0; }
.nav a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--r);
  color: rgba(255, 255, 255, 0.9);
  font-weight: 500;
}
.nav a:hover { background: rgba(255, 255, 255, 0.1); color: #fff; text-decoration: none; }
.nav a.active { background: var(--paper); color: var(--night); font-weight: 600; }
.nav .count {
  font-size: 12.5px;
  font-weight: 650;
  min-width: 22px;
  height: 22px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 11px;
  background: #fff;
  color: var(--night);
}
.nav a.active .count { background: var(--blue); color: #fff; }

.sidebar-referent {
  margin: auto 0 0;
  padding: 14px 12px;
  border-radius: var(--r);
  background: rgba(255, 255, 255, 0.1);
  font-size: 13.5px;
  line-height: 1.4;
}
.sidebar-referent .label { display: block; color: rgba(255, 255, 255, 0.7); font-size: 12.5px; margin-bottom: 2px; }
.sidebar-referent strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
/* Adresse complète, coupée proprement à la ligne (après le @ ou un point) plutôt que tronquée. */
.sidebar-referent a { display: block; color: #fff; overflow-wrap: anywhere; font-size: 13px; line-height: 1.35; }
.sidebar-referent a + a { margin-top: 3px; }
.sidebar-referent + .sidebar-user { margin-top: 14px; }
@media (max-width: 900px) { .sidebar-referent { margin-top: 10px; } }
.sidebar-user {
  margin-top: auto;
  padding: 16px 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  display: flex;
  gap: 10px;
  align-items: center;
}
.avatar {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 650;
  color: var(--night);
  background: #dcebf6;
}
.sidebar .avatar { background: rgba(255, 255, 255, 0.16); color: #fff; }
.sidebar-user .who { min-width: 0; flex: 1; line-height: 1.3; }
.sidebar-user .who a { color: #fff; font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user .who span { font-size: 13px; color: rgba(255, 255, 255, 0.68); }
.sidebar-user { flex-wrap: wrap; }
.sidebar-user .logout { flex-basis: 100%; margin: 12px 0 0; }
.sidebar-user .logout button {
  width: 100%;
  min-height: 36px;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: var(--r);
  cursor: pointer;
}
.sidebar-user .logout button:hover { background: rgba(255, 255, 255, 0.1); }
@media (max-width: 900px) { .sidebar-user .logout { flex-basis: auto; margin: 0; } .sidebar-user .logout button { padding: 0 12px; } }

.main { min-width: 0; width: 100%; max-width: 1320px; padding: 36px 44px 64px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 40px; font-stretch: 75%; font-variation-settings: "wdth" 75; font-weight: 650; line-height: 1.02; letter-spacing: -0.015em; }
.page-head .sub { color: var(--slate); margin: 8px 0 0; }
.crumbs { font-size: 14px; color: var(--slate); margin-bottom: 8px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--slate); }
.crumbs a:hover { color: var(--blue); }

@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 14px 12px 10px; }
  .brand { padding-bottom: 12px; }
  .nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
  .nav a { flex: none; }
  .nav-label { display: none; }
  .sidebar-user { margin-top: 8px; padding-top: 10px; }
  .main { padding: 24px 16px 48px; }
  .page-head h1 { font-size: 32px; }
}

/* ---------------------------------------------------------------- Blocs */

.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-lg); }
.panel + .panel, aside > .panel + .panel, .notice + .panel { margin-top: 20px; }
.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h2 { font-size: 19px; }
.panel-head .muted { font-size: 13.5px; }
.panel-body { padding: 20px; }
.panel-foot { padding: 14px 20px; border-top: 1px solid var(--line-soft); font-size: 14px; }

.cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }
.cols > *, .cols-2 > * { min-width: 0; }
@media (max-width: 1100px) { .cols, .cols-2 { grid-template-columns: minmax(0, 1fr); } }

/* Indicateurs : une ligne de compteurs, séparés par des filets */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 20px;
}
.stat { padding: 18px 20px 16px; border-left: 1px solid var(--line-soft); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat .label { font-size: 14px; color: var(--slate); }
.stat .value {
  display: block;
  margin-top: 6px;
  font-size: 34px;
  font-weight: 650;
  font-stretch: 75%; font-variation-settings: "wdth" 75;
  line-height: 1;
  color: var(--ink);
}
.stat a.value:hover { color: var(--blue); text-decoration: none; }
.stat .value.alert-value { color: var(--text-danger); }
.stat .foot { margin-top: 6px; font-size: 13px; color: var(--slate); }
@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(3) { border-left: 0; }
  .stat:nth-child(n + 3) { border-top: 1px solid var(--line-soft); }
}

.dl { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 10px 16px; margin: 0; font-size: 14.5px; }
.dl dt { color: var(--slate); }
.dl dd { margin: 0; overflow-wrap: anywhere; }

.empty { padding: 40px 24px; text-align: center; color: var(--slate); max-width: 46ch; margin: 0 auto; }
.empty strong { display: block; color: var(--ink); font-size: 17px; font-weight: 650; font-stretch: var(--narrow); font-variation-settings: "wdth" 78; margin-bottom: 4px; }

/* ---------------------------------------------------------------- Tableaux */

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th {
  text-align: left;
  font-size: 13px;
  font-weight: 550;
  color: var(--slate);
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #f8fbfd; }
.table .title-cell { min-width: 170px; }
.table td .badge { white-space: normal; }
.table .title-cell a { color: var(--ink); font-weight: 600; }
.table .title-cell a:hover { color: var(--blue); }
.table .title-cell .muted { display: block; font-size: 13px; margin-top: 1px; }
.table .title-cell .badge { margin-top: 4px; }

.filters { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; padding: 16px 20px; border-bottom: 1px solid var(--line-soft); background: var(--tint); }
.filters .field { margin: 0; min-width: 170px; }
.filters .field > span { font-size: 13px; color: var(--slate); font-weight: 500; }
.filters input[type="search"] { min-width: 240px; }
.tabs { display: flex; gap: 4px; padding: 0 12px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.tabs a { padding: 14px 10px 12px; color: var(--slate); font-weight: 550; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--ink); border-bottom-color: var(--blue); }

/* ---------------------------------------------------------------- Fil de discussion */

.thread { list-style: none; margin: 0; padding: 0; }
.msg { padding: 20px; border-bottom: 1px solid var(--line-soft); display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 14px; }
.msg:last-child { border-bottom: 0; }
.msg .meta { font-size: 13.5px; color: var(--slate); margin-bottom: 4px; display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.msg .meta strong { color: var(--ink); font-weight: 600; font-size: 14.5px; }
.msg .body { white-space: pre-wrap; overflow-wrap: anywhere; max-width: 72ch; }
.msg.staff { background: #f6fafd; }
.msg.staff .avatar { background: var(--blue); color: #fff; }
.msg.internal { background: #fffaee; box-shadow: inset 3px 0 0 var(--led-warn); }
.msg.internal .meta::after { content: "Note interne, invisible du client"; font-size: 13px; font-weight: 600; color: #8a5a00; }

/* ---------------------------------------------------------------- Annonces, contact, divers */

.notice {
  position: relative;
  padding: 18px 20px 16px 44px;
  margin-bottom: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.notice::before {
  content: "";
  position: absolute;
  left: 20px;
  top: 25px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--led-warn);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--led-warn) 22%, transparent);
}
.notice h3 { font-size: 19px; margin-bottom: 6px; }
.notice .body { white-space: pre-wrap; max-width: 75ch; }
.notice .meta { font-size: 13px; color: var(--slate); margin-top: 8px; }

.contact-card { display: flex; gap: 14px; align-items: center; }
.contact-card .avatar { width: 52px; height: 52px; font-size: 16px; background: var(--blue); color: #fff; }
.contact-card strong { display: block; font-size: 17px; font-stretch: var(--narrow); font-variation-settings: "wdth" 78; font-weight: 650; }
.contact-card a, .contact-card .small { display: block; }

.link-box { display: flex; gap: 8px; }
.link-box input { font-family: ui-monospace, Consolas, monospace; font-size: 13px; }

.bar-row { display: grid; grid-template-columns: 120px minmax(0, 1fr) 28px; gap: 12px; align-items: center; font-size: 14px; padding: 6px 0; }
.bar-row a { color: var(--ink); }
.bar-row svg { width: 100%; height: 8px; display: block; }
.bar-row .track { fill: var(--line-soft); }
.bar-row .fill { fill: var(--blue); }

.catalog-cat { font-size: 15px; font-weight: 650; font-stretch: var(--narrow); font-variation-settings: "wdth" 78; padding: 18px 20px 8px; color: var(--night); }
.catalog-cat:not(:first-child) { border-top: 1px solid var(--line); }
.catalog-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 20px; border-top: 1px solid var(--line-soft); }
.catalog-cat + .catalog-row { border-top: 0; }
.catalog-row strong { display: block; font-weight: 600; }
.catalog-row .muted, .catalog-row .mono { display: block; }
.qty { display: flex; align-items: center; gap: 6px; flex: none; }
.qty input[type="number"] { width: 56px; text-align: center; min-height: 36px; padding: 4px; -moz-appearance: textfield; appearance: textfield; font-weight: 600; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty .btn.small { width: 36px; min-height: 36px; padding: 0; font-size: 18px; font-weight: 500; }

.catalog-edit { display: grid; grid-template-columns: 1fr 1.4fr 1.6fr 0.8fr 70px auto auto; gap: 8px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line-soft); }
.catalog-edit input { min-height: 36px; padding: 6px 10px; font-size: 14px; }
.catalog-edit .check { margin: 0; white-space: nowrap; }
@media (max-width: 1100px) { .catalog-edit { grid-template-columns: 1fr 1fr; } }

/* Scanner à la douchette : un grand champ toujours prêt à recevoir le code */
.scan-field input {
  min-height: 64px;
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-width: 2px;
  border-color: var(--blue);
}
.scan-field input::placeholder { font-weight: 400; letter-spacing: 0; }
.scan-field input:focus { box-shadow: 0 0 0 4px rgba(10, 111, 176, 0.18); }
.scan-panel + .panel { margin-top: 20px; }
.warranty-check { display: grid; gap: 10px; margin: -4px 0 20px; padding: 12px 14px; background: var(--tint); border: 1px solid var(--line-soft); border-radius: var(--r); }
.warranty-check [data-warranty-status] { color: var(--slate); flex: 1; min-width: 200px; }
.plain-list { margin: 0; padding: 0; list-style: none; }
.plain-list li { padding: 6px 0; border-top: 1px solid var(--line-soft); }
.plain-list li:first-child { border-top: 0; }

.error-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: var(--mist); }
.error-page .box { max-width: 460px; }
.error-page .error-brand { margin: 0; font-weight: 650; font-stretch: 75%; font-variation-settings: "wdth" 75; color: var(--blue); font-size: 18px; }
.error-page h1 { font-size: 48px; font-stretch: 75%; font-variation-settings: "wdth" 75; margin: 20px 0 10px; }
.error-page p { color: var(--slate); }
