@charset "UTF-8";
:root {
  --teal: #036666;
  --teal-dark: #024f4f;
  --turq: #04A29A;
  --green: #B1CB21;
  --leaf: #61B87A;
  --sky: #4FBCC1;
  --mint: #A7D4BA;
  --bg: #f3f6f6;
  --card: #ffffff;
  --text: #1d2b2b;
  --muted: #647474;
  --line: #dde6e6;
  --red: #c0392b;
  --orange: #d9822b;
  --blue: #2f76b5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(3, 102, 102, .06), 0 2px 8px rgba(3, 102, 102, .05);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif; font-weight: 500;
}
a { color: var(--teal); }
h1, h2 { font-weight: 800; letter-spacing: -.01em; margin: 0 0 .4em; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.05rem; color: var(--teal); }
code { background: #eef4f4; padding: 1px 5px; border-radius: 4px; font-size: .85em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }

/* Barre du haut */
.topbar { background: var(--teal); color: #fff; }
.topbar-inner { max-width: 1280px; margin: 0 auto; padding: 10px 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.1rem; }
.brand small { display: block; font-weight: 500; font-size: .75rem; opacity: .8; }
.brand span { line-height: 1.1; }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { color: #e6f4f3; text-decoration: none; padding: 7px 10px; font-size: .93rem; border-radius: 8px; font-weight: 600; }
nav a:hover { background: rgba(255,255,255,.1); }
nav a.active { background: rgba(255,255,255,.18); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
@media (max-width: 1440px) { .user-name { display: none; } }
.col-side .facts dd { white-space: nowrap; }
.user-link { display: flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; font-weight: 600; font-size: .9rem; padding: 4px 8px 4px 4px; border-radius: 99px; }
.user-link:hover, .user-link.active { background: rgba(255,255,255,.14); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #203000; display: grid; place-items: center; font-weight: 800; font-size: .85rem; }
.logout-btn { background: none; border: 1px solid rgba(255,255,255,.35); color: #fff; font: inherit; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; }
.logout-btn { display: inline-flex; align-items: center; gap: 6px; }
.logout-btn .ico { width: 14px; height: 14px; }
.logout-btn:hover { background: rgba(255,255,255,.12); }
.pill-test { background: var(--green); color: #203000; font-weight: 700; font-size: .75rem; padding: 4px 10px; border-radius: 99px; }

.container { max-width: 1280px; margin: 0 auto; padding: 22px 16px 60px; }
.container.narrow { max-width: 980px; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.back { display: inline-block; font-size: .85rem; text-decoration: none; margin-bottom: 6px; }
.eyebrow { margin: 0; text-transform: uppercase; font-size: .72rem; letter-spacing: .08em; color: var(--turq); font-weight: 700; }

.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 20px; margin-bottom: 16px; border: 1px solid #e7eeee; }
.card.empty { text-align: center; padding: 40px 20px; color: var(--muted); }

/* Boutons */
.btn { display: inline-flex; align-items: center; gap: 6px; justify-content: center; font: inherit; font-weight: 700; font-size: .9rem;
  padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: #fff; color: var(--teal); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--turq); }
.btn-primary { background: var(--turq); border-color: var(--turq); color: #fff; }
.btn-primary:hover { background: var(--teal); border-color: var(--teal); }
.btn-green { background: var(--leaf); border-color: var(--leaf); color: #fff; }
.btn-danger-ghost { color: var(--red); }
.btn-danger-ghost:hover { border-color: var(--red); }
.btn-small { padding: 4px 10px; font-size: .8rem; }
.btn-large { padding: 12px 22px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-stack { display: grid; gap: 8px; margin: 12px 0; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: .8rem; color: var(--teal); cursor: pointer; text-decoration: underline; }
.link-btn.danger { color: var(--red); }
form.inline { display: inline; }

/* Badges */
.badge { display: inline-block; font-size: .75rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; white-space: nowrap; vertical-align: middle; }
.badge-grey { background: #e9eeee; color: #4d5e5e; }
.badge-blue { background: #e1eefa; color: var(--blue); }
.badge-green { background: #e7f4d0; color: #4c6a00; }
.badge-orange { background: #fdecd8; color: #9a5210; }
.badge-red { background: #fbe1de; color: var(--red); }
.badge-teal { background: #d8efee; color: var(--teal); }
.tag { display: inline-block; font-size: .7rem; padding: 1px 6px; border-radius: 4px; background: #eef4f4; color: var(--muted); margin-left: 4px; }

.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-weight: 600; }
.flash-ok { background: #e7f4d0; color: #3f5800; }
.flash-error { background: #fbe1de; color: #8f261b; }
.flash-warn { background: #fdecd8; color: #8a4a0e; }

/* Onglets + filtres */
.tabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 12px; }
.tabs a { text-decoration: none; padding: 6px 12px; border-radius: 99px; color: var(--muted); font-weight: 600; font-size: .88rem; background: #fff; border: 1px solid var(--line); }
.tabs a.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.tabs .count { opacity: .7; font-size: .8em; margin-left: 2px; }
.filters { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.filters input[type=search] { flex: 1 1 280px; width: auto; }
.filters select { flex: 0 1 240px; width: auto; }

/* Formulaires */
input, select, textarea { font: inherit; font-weight: 500; color: var(--text); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
input:focus, select:focus, textarea:focus, .editor-area:focus { outline: 2px solid rgba(4,162,154,.35); border-color: var(--turq); }
input[readonly], textarea[readonly], select:disabled { background: #f6f8f8; color: var(--muted); }
textarea { resize: vertical; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: .9rem; line-height: 1.55; }
.form label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 12px; color: #2c3c3c; }
.form label > input, .form label > select, .form label > textarea, .form label > .dropzone { margin-top: 4px; }
.form label small { font-weight: 500; color: var(--muted); }
.form h2 { margin-top: 6px; }
.form h2 + * { margin-top: 0; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.row > label { flex: 1 1 180px; }
.row > label.grow { flex: 2 1 260px; }
.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.check { display: flex !important; align-items: center; gap: 8px; font-weight: 600 !important; }
.check input { width: auto; }
.big-check { padding: 14px; background: #f1f8f1; border: 1px solid #cfe5c4; border-radius: 8px; font-size: .95rem !important; }
.big-check input { width: 20px; height: 20px; }
fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 0 0 12px; }
legend { font-weight: 700; font-size: .85rem; padding: 0 4px; }
.address-field.hidden { display: none; }

/* Dépôt de fichiers */
.dropzone { position: relative; border: 2px dashed #b9d4d3; border-radius: 10px; padding: 18px; text-align: center; color: var(--muted); background: #f8fbfb; transition: .15s; cursor: pointer; }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.dropzone.over { border-color: var(--turq); background: #e9f6f5; color: var(--teal); }
.dropzone span { font-weight: 600; font-size: .9rem; pointer-events: none; }
.dz-list { list-style: none; margin: 8px 0 0; padding: 0; font-size: .85rem; color: var(--teal); pointer-events: none; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
.card.table-wrap { padding: 0; }
.table { width: 100%; border-collapse: collapse; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); background: #fafcfc; white-space: nowrap; }
.table td { padding: 10px 12px; border-bottom: 1px solid #edf2f2; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num { text-align: right; white-space: nowrap; }
.table.clickable tbody tr { cursor: pointer; }
.table.clickable tbody tr:hover { background: #f4fafa; }
.ref { font-weight: 800; text-decoration: none; white-space: nowrap; }
.row-warn { background: #fff7ef; }
.row-muted { opacity: .6; }
.lines-table select { min-width: 120px; }
.lines-table input { min-width: 180px; }

/* Fiche commande */
.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; align-items: start; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; font-weight: 600; }
.facts-row { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.inline-status label { font-size: .8rem; color: var(--muted); font-weight: 600; }
.inline-status select { margin-top: 4px; font-size: .85rem; padding: 6px 8px; }
.copy-field { display: flex; gap: 6px; }
.copy-field input { font-size: .78rem; padding: 6px 8px; }
.files { list-style: none; margin: 0 0 12px; padding: 0; }
.files li { padding: 8px 0; border-bottom: 1px solid #edf2f2; display: grid; gap: 2px; }
.files li a { font-weight: 700; word-break: break-all; }
.file-actions { display: flex; gap: 12px; }
.file-actions form { display: inline; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { padding: 6px 0 6px 12px; border-left: 3px solid var(--mint); margin-bottom: 6px; display: grid; }
.timeline li.ev-supplier { border-left-color: var(--sky); }
.timeline .when { font-size: .75rem; color: var(--muted); }
.timeline .what { font-size: .85rem; }
.supplier-msg { border-left: 4px solid var(--sky); }

/* Éditeur de mail */
.editor { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; margin: 4px 0 12px; background: #fff; }
.editor-toolbar { display: flex; gap: 2px; padding: 6px; background: #f6f9f9; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.editor-toolbar button { border: 0; background: none; padding: 5px 9px; border-radius: 6px; cursor: pointer; font: inherit; font-size: .85rem; color: var(--text); }
.editor-toolbar button:hover { background: #e3eeee; }
.editor-toolbar .sep { width: 1px; background: var(--line); margin: 2px 4px; }
.editor-area { min-height: 280px; padding: 14px 16px; font-family: Arial, Helvetica, sans-serif; font-size: 15px; line-height: 1.5; font-weight: 400; }
.editor-area.small-area { min-height: 80px; }
.editor-area p { margin: 0 0 .8em; }
.mail-fields label { display: grid !important; grid-template-columns: 70px 1fr; align-items: center; gap: 8px; margin-bottom: 8px !important; }
.mail-fields label > input { margin: 0 !important; }
.link-preview { background: #f8fbfb; border: 1px dashed #b9d4d3; border-radius: 8px; padding: 14px; margin-bottom: 14px; }
.fake-btn { display: inline-block; background: var(--turq); color: #fff; font-weight: 700; padding: 10px 18px; border-radius: 6px; font-family: Arial, sans-serif; }

/* Boîte d'envoi */
.outbox { grid-template-columns: 360px minmax(0, 1fr); }
.mail-list { list-style: none; margin: 0; padding: 0; max-height: 75vh; overflow: auto; }
.mail-list .tag { justify-self: start; margin: 0; }
.mail-list li a { display: grid; gap: 2px; padding: 10px; border-radius: 8px; text-decoration: none; color: var(--text); }
.mail-list li.active a, .mail-list li a:hover { background: #eef6f6; }
.mail-frame { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: 8px; margin-top: 12px; background: #fff; }

/* Page fournisseur */
.head-card .head-line { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; align-items: flex-start; }
.head-card h1 { font-size: 1.8rem; margin: 2px 0 0; }
.footnote { text-align: center; color: var(--muted); font-size: .8rem; margin-top: 24px; }

@media (max-width: 900px) {
  .grid-2, .outbox { grid-template-columns: minmax(0, 1fr); }
  .topbar-inner { gap: 10px; }
  h1 { font-size: 1.35rem; }
  .card { padding: 14px; }
  .mail-fields label { grid-template-columns: 1fr; gap: 2px; }
}

/* Connexion */
body.auth { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #036666 0%, #04A29A 60%, #61B87A 100%); }
.auth-wrap { width: 100%; padding: 24px 16px; }
.auth-card { max-width: 400px; margin: 0 auto; background: #fff; border-radius: 14px; padding: 28px; box-shadow: 0 18px 50px rgba(0,40,40,.25); }
.auth-card h1 { font-size: 1.35rem; margin-bottom: 14px; }
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand strong { display: block; font-size: 1.2rem; font-weight: 800; color: var(--teal); line-height: 1.1; }
.auth-brand span { font-size: .85rem; color: var(--muted); }
.auth-foot { margin: 16px 0 0; text-align: center; }
.pwd-field { position: relative; display: block; margin-top: 4px; }
.pwd-field input { padding-right: 42px; }
.pwd-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; cursor: pointer; font-size: 1rem; opacity: .6; }
.pwd-toggle:hover { opacity: 1; }

/* Utilisateurs / droits */
.perm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px; margin-bottom: 12px; }
.perm { display: flex !important; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; font-weight: 500 !important; cursor: pointer; }
.perm input { width: auto; margin-top: 3px; }
.perm strong { display: block; font-size: .9rem; }
.perm small { color: var(--muted); font-size: .78rem; }
.perm:has(input:checked) { border-color: var(--turq); background: #f1faf9; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.key-reveal { background: #fffbe6; border: 1px solid #f0d77a; border-radius: 8px; padding: 14px; margin-bottom: 16px; }
.key-reveal code { display: block; font-size: .95rem; padding: 10px; margin: 8px 0; background: #fff; word-break: break-all; user-select: all; }
.subtabs { display: flex; gap: 4px; margin-bottom: 14px; border-bottom: 1px solid var(--line); flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs a { white-space: nowrap; border-radius: 0; font-size: .92rem; padding: 8px 14px; text-decoration: none; font-weight: 700; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -1px; }
.subtabs a.active { color: var(--teal); border-bottom-color: var(--turq); }

/* Consultations */
.kind-tag { white-space: nowrap; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; padding: 3px 8px; border-radius: 6px; vertical-align: middle; }
.kind-consultation { background: #fff3c4; color: #7a5a00; }
.kind-commande { background: #d8efee; color: var(--teal); }
.flash-info { background: #e6f2fb; color: #1f5582; }
.flash-info a { color: inherit; }
.convert-card { display: flex; gap: 16px; align-items: center; justify-content: space-between; flex-wrap: wrap; border-left: 4px solid var(--leaf); background: #f4faf2; }
.convert-row { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.convert-row input, .convert-row select { width: auto; min-width: 180px; margin: 0; }
.dup-other label { font-size: .8rem; color: var(--muted); font-weight: 600; display: grid; gap: 4px; }
.dup-other select { min-width: 0; flex: 1; }
.intro { margin-top: -6px; }
.text-red { color: var(--red); font-weight: 700; }
.table tfoot td { border-top: 2px solid var(--line); background: #fafcfc; }
.price-input { width: 110px; text-align: right; }
.total-line { text-align: right; margin: 12px 4px 0; font-size: 1rem; }
.doc pre { background: #0f2b2b; color: #d9f2ef; padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: .82rem; line-height: 1.5; }
.doc h3 { font-size: .95rem; margin: 16px 0 6px; }
.doc .table td { vertical-align: top; font-size: .88rem; }

/* Icônes SVG */
.ico { width: 1.05em; height: 1.05em; vertical-align: -0.16em; flex: none; }
.btn .ico { width: 16px; height: 16px; }
.link-btn .ico { width: 13px; height: 13px; }
.editor-toolbar button { display: inline-flex; align-items: center; gap: 4px; }
.pwd-toggle { display: grid; place-items: center; color: var(--muted); }
.pwd-toggle .ico { width: 18px; height: 18px; }
.dz-list li::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--turq); margin-right: 8px; vertical-align: middle; }
.badge .ico, .tag .ico { width: 12px; height: 12px; vertical-align: -2px; }

/* Retours fournisseur modifiables */
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lines-edit select { min-width: 120px; padding: 6px 8px; font-size: .88rem; }
.lines-edit input { padding: 6px 8px; font-size: .88rem; min-width: 160px; }
.lines-edit .price-input { min-width: 0; width: 100px; }
.lines-foot { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.lines-foot .actions { margin: 0 0 12px; }
.lines-foot label { display: block; font-weight: 700; font-size: .85rem; color: #2c3c3c; }
.lines-foot label small { font-weight: 500; color: var(--muted); }
.lines-foot label input { margin-top: 4px; }

.mail-tail { font-family: Arial, sans-serif; font-size: 14px; line-height: 1.6; color: #333; background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; margin: 6px 0 10px; }
.mail-tail p { margin: 0 0 10px; }
.mail-tail u { color: #1a55a8; }
.reset-tpl { margin: -8px 0 16px; text-align: right; }
.logo-preview { max-width: 280px; height: auto; display: block; border: 1px solid var(--line); border-radius: 6px; padding: 6px; background: #fff; }
.mail-tail .logo-preview { border: 0; padding: 0; max-width: 240px; }
.mail-tail .fake-btn { margin: 6px 0 14px; }
.tail-portal { background: #f3f6f6; border-radius: 6px; padding: 12px 14px; font-size: 13px; color: #3d4d4d; margin: 0 0 14px; }

/* Tableau des articles (page fournisseur + fiche) : colonne commentaire plus large */
.lines-table td:last-child { width: 34%; }
.lines-table td:nth-last-child(2) { width: 150px; }
.lines-table .num { width: 1%; }

/* ===================== Mobile ===================== */
@media (max-width: 720px) {
  body { font-size: 15px; }
  /* 16px évite le zoom automatique d'iOS sur les champs */
  input, select, textarea, .editor-area { font-size: 16px; }
  .container { padding: 14px 12px 48px; }
  h1 { font-size: 1.3rem; }
  .card { padding: 14px 14px; margin-bottom: 12px; border-radius: 12px; }

  /* Barre du haut : logo + compte sur une ligne, menu défilant dessous */
  .topbar-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand right" "nav nav"; gap: 8px; padding: 10px 12px 0; }
  .brand { grid-area: brand; font-size: 1rem; }
  .topbar-right { grid-area: right; margin: 0; width: auto; gap: 6px; }
  .topbar nav { grid-area: nav; flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px; padding: 0 12px 8px; gap: 2px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .topbar nav::-webkit-scrollbar { display: none; }
  .topbar nav a { white-space: nowrap; flex: none; padding: 8px 12px; }
  .pill-test { font-size: .68rem; padding: 3px 8px; white-space: nowrap; }
  textarea.mono { height: 240px; }
  .logout-btn { padding: 6px 8px; }
  .logout-btn span { display: none; }
  .logout-btn .ico { width: 18px; height: 18px; }
  .brand { min-width: 0; }
  .brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* En-têtes de page et boutons */
  .page-head { align-items: stretch; gap: 10px; margin-bottom: 12px; }
  .page-head > .btn, .page-head > .btn-row { width: 100%; }
  .page-head .btn-row .btn { flex: 1 1 auto; }
  .actions .btn, .btn-large { flex: 1 1 auto; }
  .btn { padding: 10px 14px; }
  .btn-small { padding: 6px 10px; }

  /* Onglets et filtres : une ligne qui défile */
  .tabs { flex-wrap: nowrap; overflow-x: auto; margin: 0 -12px 12px; padding: 0 12px 2px; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a { flex: none; white-space: nowrap; padding: 7px 12px; }
  .filters input[type=search] { flex: 1 1 100%; }
  .filters select { flex: 1 1 auto; }

  /* Formulaires : un champ par ligne */
  .row { display: block; }
  .row > label, .row > .actions { width: 100%; }
  .form label { margin-bottom: 14px; }

  /* Tableaux → fiches */
  .card.table-wrap { background: transparent; box-shadow: none; border: 0; overflow: visible; }
  .table:not(.no-stack), .table:not(.no-stack) tbody { display: block; }
  .table:not(.no-stack) thead { display: none; }
  .table:not(.no-stack) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; padding: 12px 14px; background: #fff; border: 1px solid #e7eeee; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 10px; }
  .table:not(.no-stack) tr.row-warn { background: #fff7ef; }
  .table:not(.no-stack) td { display: block; padding: 0; border: 0; min-width: 0; overflow-wrap: anywhere; }
  .table:not(.no-stack) td[data-label]::before { content: attr(data-label); display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; margin-bottom: 1px; }
  .table:not(.no-stack) td:first-child { grid-column: 1 / -1; font-size: 1.02rem; }
  .table:not(.no-stack) td:first-child::before { display: none; }
  .table:not(.no-stack) td.wide { grid-column: 1 / -1; }
  .table:not(.no-stack) td:empty { display: none; }
  .table:not(.no-stack) .num { text-align: left; }
  .table:not(.no-stack) td.actions-cell { display: flex; gap: 8px; align-items: center; }
  .table:not(.no-stack) td.actions-cell::before { display: none; }
  .table.clickable tbody tr:hover { background: #fff; }
  .table .ref { white-space: normal; }

  /* Articles : quantité + article sur une ligne, puis dispo et commentaire */
  .table.lines-table tr { grid-template-columns: 64px minmax(0, 1fr); gap: 6px 10px; padding: 12px; box-shadow: none; }
  .table.lines-table td { width: auto !important; }
  .table.lines-table td.pos { display: none; }
  .table.lines-table td:first-child, .table.lines-table td.pos + td { grid-column: auto; font-size: 1rem; }
  .table.lines-table td.num::before { display: none; }
  .table.lines-table td.num + td { font-weight: 700; }
  .table.lines-table td.num + td::before { display: none; }
  .table.lines-table td:nth-last-child(-n+2) { grid-column: 1 / -1; }
  .table.lines-table td:nth-last-child(-n+2)::before { display: none; }
  .lines-edit input, .lines-edit select, .lines-table input, .lines-table select { min-width: 0; width: 100%; }

  /* Fiche commande */
  .facts { grid-template-columns: minmax(0, 1fr) auto; font-size: .88rem; }
  .facts dd { text-align: right; white-space: nowrap; }
  .copy-field { flex-wrap: wrap; }
  .copy-field input { flex: 1 1 100%; }
  .convert-row { flex-wrap: wrap; }
  .convert-row input, .convert-row select, .convert-row .btn { flex: 1 1 100%; min-width: 0; }
  .editor-area { min-height: 220px; padding: 12px; }
  .mail-list { max-height: none; }
  .mail-frame { height: 60vh; }
  .logo-preview, .mail-tail .logo-preview { max-width: 100%; }
  .perm-grid { grid-template-columns: 1fr; }

  /* Page fournisseur */
  .head-card h1 { font-size: 1.45rem; overflow-wrap: anywhere; }
  .head-card .head-line { flex-direction: column-reverse; gap: 6px; }
  .big-check { font-size: .92rem !important; }

  /* Connexion */
  .auth-card { padding: 22px 18px; }
}
