/* ERP Etudelec — feuille de style unique
   Univers : armoire électrique. Fond gris armoire, encre de schéma,
   une couleur de conducteur par application (bande « wire »). */

:root {
  --bg: #ecedea;          /* gris armoire clair (proche RAL 7035) */
  --panel: #ffffff;
  --ink: #1e2930;         /* encre de schéma */
  --ink-2: #4f5d66;
  --ink-3: #7a868d;
  --rule: #d5d8d3;
  --rule-2: #e4e6e2;
  --rail: #222c33;        /* colonne latérale */
  --rail-ink: #c9d1d5;
  --rail-hover: #2d3941;
  --action: #2c64a8;
  --action-ink: #ffffff;
  --action-soft: #e6eef8;
  --ok: #2b7a4b;   --ok-soft: #e3f1e8;
  --warn: #9a6400; --warn-soft: #fbf0d9;
  --danger: #b5372b; --danger-soft: #f9e4e1;
  --pe: repeating-linear-gradient(135deg, #3c9a3c 0 6px, #e6c619 6px 12px);
  --focus: 0 0 0 3px rgba(44, 100, 168, .35);

  --font-din: "Bahnschrift", "DIN Alternate", "DIN 2014", "D-DIN", "Barlow", "Arial Narrow", system-ui, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --topbar-h: 52px;
  --rail-w: 236px;
  --r-sm: 3px;
  --r: 5px;
}

/* Couleurs de conducteur par application */
.c-agenda      { --wire: #c49a1a; }
.c-employes    { --wire: #8a5a34; }
.c-tiers       { --wire: #2c64a8; }
.c-produits    { --wire: #7b8287; }
.c-projets     { --wire: #1e2328; }
.c-offres      { --wire: #d27a1f; }
.c-achats      { --wire: #6c4b97; }
.c-stock       { --wire: #1d8584; }
.c-prestations { --wire: #b5372b; }
.c-facturation { --wire: #2b7a4b; }
.c-societe     { --wire: #3c9a3c; }
.c-parametres  { --wire: #55657a; }
.c-utilisateurs{ --wire: #9b4a72; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.5 var(--font-body);
}
h1, h2, h3 { font-family: var(--font-din); font-weight: 600; letter-spacing: .005em; line-height: 1.2; margin: 0; }
h1 { font-size: 26px; }
h2 { font-size: 18px; margin-bottom: 12px; }
a { color: var(--action); }
a:hover { color: #1f4d84; }
code { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: .92em; background: var(--rule-2); padding: 1px 5px; border-radius: var(--r-sm); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
[hidden] { display: none !important; }
.muted { color: var(--ink-2); }
.small { font-size: 13px; }
.num { font-family: var(--font-din); font-variant-numeric: tabular-nums; white-space: nowrap; }
.right { text-align: right; }
.icon { flex: none; }

/* --- Barre du haut ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: 6px; padding: 0 12px 0 0;
  background: var(--rail); color: #fff;
}
.nav-toggle {
  width: 52px; height: var(--topbar-h); border: 0; background: transparent; color: var(--rail-ink);
  font: 600 22px/1 var(--font-din); cursor: pointer;
}
.nav-toggle:hover { color: #fff; background: var(--rail-hover); }
.nav-toggle .when-closed, .nav-collapsed .nav-toggle .when-open { display: none; }
.nav-collapsed .nav-toggle .when-closed { display: inline; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; }
.brand-mark {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: var(--r-sm);
  background: #fff; color: var(--rail); font: 700 17px/1 var(--font-din);
}
.brand-name { font: 600 17px/1 var(--font-din); letter-spacing: .02em; }
.brand-logo { display: block; height: 24px; width: auto; }
.brand-version { font: 500 12px/1 var(--font-din); letter-spacing: .04em; color: var(--rail-ink); opacity: .85; white-space: nowrap; }
.topbar-tools { display: flex; align-items: center; gap: 4px; }
.tool {
  position: relative; display: grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--r); background: transparent; color: var(--rail-ink); cursor: pointer;
}
.tool:hover, .drop[open] > .tool { background: var(--rail-hover); color: #fff; }
.tool .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; border-radius: 50%; background: #e6c619; }
.fs-shell { position: fixed; inset: 0; z-index: 1000; background: var(--bg, #eceae6); }
.fs-shell iframe { display: block; width: 100%; height: 100%; border: 0; }
.fs-exit, .is-fullscreen .fs-enter { display: none; }
.is-fullscreen .fs-exit { display: block; }

.drop { position: relative; }
.drop > summary { list-style: none; }
.drop > summary::-webkit-details-marker { display: none; }
.drop-panel {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 280px; padding: 6px;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(20, 30, 36, .18);
}
.drop-title { margin: 6px 10px 6px; font: 600 13px/1.3 var(--font-din); color: var(--ink-3); }
.drop-row {
  display: flex; flex-direction: column; width: 100%; padding: 8px 10px; border: 0; border-radius: var(--r-sm);
  background: none; color: var(--ink); text-align: left; text-decoration: none; font: inherit; cursor: pointer;
}
.drop-row small { color: var(--ink-3); }
.drop-row:hover { background: var(--action-soft); color: var(--ink); }
.drop-empty { margin: 4px 10px 10px; color: var(--ink-2); font-size: 13px; }
.drop-foot { display: block; margin-top: 4px; padding: 8px 10px; border-top: 1px solid var(--rule-2); font-size: 13px; }

.user-chip {
  display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 10px 0 6px;
  border-radius: var(--r); cursor: pointer; color: #fff;
}
.user-chip:hover, .drop[open] > .user-chip { background: var(--rail-hover); }
.avatar {
  display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
  background: #3a4852; color: #fff; font: 600 12px/1 var(--font-din); letter-spacing: .04em;
}
.user-name { font-size: 14px; }

/* --- Colonne des applications ------------------------------------------- */
.shell { display: flex; min-height: calc(100vh - var(--topbar-h)); }
.sidebar {
  position: sticky; top: var(--topbar-h); align-self: flex-start; z-index: 35;   /* au-dessus de l'en-tête de page (30) : menus volants visibles */
  width: var(--rail-w); height: calc(100vh - var(--topbar-h)); flex: none;
  background: var(--rail); color: var(--rail-ink); padding: 8px 0 16px;
  transition: margin-left .18s ease;
}
.nav-collapsed .sidebar { margin-left: calc(-1 * var(--rail-w)); }
.nav-home, .nav-link {
  position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 16px 9px 22px;
  color: var(--rail-ink); text-decoration: none; font-size: 14px; cursor: pointer;
}
.nav-home { margin-bottom: 8px; }
.nav-home:hover, .nav-link:hover, .nav-app:hover > .nav-link, .nav-app:focus-within > .nav-link { background: var(--rail-hover); color: #fff; }
.nav-home.is-current, .nav-app.is-current > .nav-link { color: #fff; background: #303d46; }
.nav-list { list-style: none; margin: 0; padding: 0; }
.nav-app { position: relative; }
.wire { position: absolute; left: 0; top: 7px; bottom: 7px; width: 5px; border-radius: 0 2px 2px 0; background: var(--wire); }
.nav-app.is-current .wire { width: 7px; }
.wire-pe, .wire.wire-pe { background: var(--pe); }
.is-soon > .nav-link { color: #8b979e; }
.soon { margin-left: auto; font-size: 11px; color: #75828a; }

.flyout {
  position: absolute; left: 100%; top: 0; min-width: 220px; padding: 6px; z-index: 50;
  background: var(--panel); color: var(--ink); border: 1px solid var(--rule); border-left: 4px solid var(--wire);
  border-radius: 0 var(--r) var(--r) 0; box-shadow: 0 10px 30px rgba(20, 30, 36, .2);
  visibility: hidden; opacity: 0; transform: translateX(-4px); transition: opacity .12s, transform .12s, visibility 0s .12s;
}
.flyout.wire-pe { border-left-color: #3c9a3c; }
.c-societe .flyout { border-left-color: #3c9a3c; }
.nav-app:hover > .flyout, .nav-app:focus-within > .flyout {
  visibility: visible; opacity: 1; transform: none; transition: opacity .12s, transform .12s;
}
.flyout-title { margin: 4px 10px 4px; font: 600 14px/1.3 var(--font-din); }
.flyout a, .flyout-soon { display: block; padding: 7px 10px; border-radius: var(--r-sm); font-size: 14px; text-decoration: none; color: var(--ink); }
.flyout a:hover { background: var(--action-soft); }
.flyout-soon { color: var(--ink-3); }
.scrim { display: none; }

/* --- Contenu ------------------------------------------------------------- */
.page { flex: 1; min-width: 0; padding: 24px 32px 64px; }
.page-title { margin-bottom: 20px; }

.app-head {
  position: relative; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 28px;
  margin: -24px -32px 24px; padding: 20px 32px 0 40px; background: var(--panel); border-bottom: 1px solid var(--rule);
}
.app-wire { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--wire); }
.app-head > div:first-of-type { padding-bottom: 14px; }
.app-name { margin: 0 0 2px; font: 600 13px/1.2 var(--font-din); color: var(--ink-3); }
/* Onglets du module : intercalaires séparés, teintés de la couleur du module ; l'onglet ouvert est plein */
.app-tabs { display: flex; gap: 4px; align-self: flex-end; order: 3; flex-basis: 100%; overflow-x: auto; padding-top: 2px; }
.app-tabs a {
  padding: 8px 16px 9px; color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap;
  background: color-mix(in srgb, var(--wire) 9%, #fff);
  border: 1px solid color-mix(in srgb, var(--wire) 35%, #fff); border-bottom: 0; border-radius: 8px 8px 0 0;
  box-shadow: inset 0 3px 0 color-mix(in srgb, var(--wire) 55%, #fff);
  transition: background-color .12s, color .12s;
}
.app-tabs a:hover { background: color-mix(in srgb, var(--wire) 18%, #fff); }
.app-tabs a:focus-visible { outline: 2px solid var(--wire); outline-offset: -2px; }
.app-tabs a[aria-current="page"] {
  background: var(--wire); border-color: var(--wire); color: #fff; font-weight: 600; box-shadow: none;
}
.c-societe .app-tabs a[aria-current="page"] { background: #2f7d32; border-color: #2f7d32; box-shadow: inset 0 3px 0 #e6c619; }
.c-societe .app-tabs a { box-shadow: inset 0 3px 0 #e6c619; }

/* Sous-onglets d'une page (liste / historique des e-mails) */
.sub-tabs { display: inline-flex; gap: 0; margin: 0 0 14px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; background: var(--panel); }
.sub-tabs a { padding: 7px 16px; color: var(--ink-2); text-decoration: none; font-size: 14px; border-left: 1px solid var(--rule); }
.sub-tabs a:first-child { border-left: 0; }
.sub-tabs a:hover { background: color-mix(in srgb, var(--wire, #556) 10%, #fff); color: var(--ink); }
.sub-tabs a[aria-current="page"] { background: color-mix(in srgb, var(--wire, #556) 16%, #fff); color: var(--ink); font-weight: 600; }
.mail-fold > summary { cursor: pointer; list-style: revert; }
.mail-fold > summary h2 { display: inline; }
.head-actions { display: flex; gap: 8px; align-items: center; margin-left: auto; padding-bottom: 14px; }
.head-actions form { display: flex; gap: 6px; margin: 0; }

.panel { background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); padding: 20px 22px; margin-bottom: 16px; }
.panel-narrow { max-width: 620px; }
.panel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.panel-grid .panel { margin: 0; }
.panel-grid-wide { grid-template-columns: minmax(0, 3fr) minmax(280px, 2fr); }
.panel-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.panel-head .head-actions { padding: 0; }

.flash { padding: 10px 14px; border-radius: var(--r); margin-bottom: 14px; border-left: 4px solid; font-size: 14px; }
.flash-ok { background: var(--ok-soft); border-color: var(--ok); }
.flash-error { background: var(--danger-soft); border-color: var(--danger); }
.flash-info, .flash-message { background: var(--action-soft); border-color: var(--action); }
.flash-warn { background: var(--warn-soft); border-color: var(--warn); }

/* --- Formulaires --------------------------------------------------------- */
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 5px; min-width: 0; }
.field > span { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.field small { color: var(--ink-3); font-size: 12.5px; }
.field small.error, small.error { color: var(--danger); }
.field-inline { display: flex; align-items: center; gap: 10px; }
.field-inline > span { white-space: nowrap; }
input, select, textarea {
  width: 100%; min-height: 38px; padding: 7px 10px; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #c3c8c2; border-radius: var(--r-sm);
}
input[type="checkbox"] { width: 16px; min-height: 0; height: 16px; accent-color: var(--action); }
input[type="file"] { border-style: dashed; background: var(--bg); padding: 6px; font-size: 13px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--action); box-shadow: var(--focus); }
input[readonly] { background: var(--bg); color: var(--ink-2); }
.has-error input { border-color: var(--danger); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.span-2 { grid-column: span 2; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.actions .field-inline { margin-right: auto; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline-form .field { flex: 1 1 200px; }
.code-input { font: 600 22px/1 var(--font-din); letter-spacing: .3em; text-align: center; max-width: 220px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px; padding: 0 16px;
  font: 600 14px/1 var(--font-body); color: var(--ink); text-decoration: none; white-space: nowrap;
  background: #fff; border: 1px solid #c3c8c2; border-radius: var(--r-sm); cursor: pointer;
}
.btn:hover { border-color: var(--ink-3); color: var(--ink); }
.btn-primary { background: var(--action); border-color: var(--action); color: var(--action-ink); }
.btn-primary:hover { background: #24548e; border-color: #24548e; color: #fff; }
.btn-quiet { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-quiet:hover { background: var(--rule-2); border-color: transparent; }
.btn-danger { color: var(--danger); border-color: #e2b4ae; }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.btn-danger-text { color: var(--danger); }
.btn-small { min-height: 30px; padding: 0 10px; font-size: 13px; }
.btn-wide { width: 100%; min-height: 42px; }
.icon-btn {
  width: 30px; height: 30px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; color: var(--ink-2); font-size: 15px; cursor: pointer;
}
.icon-btn:hover:not(:disabled) { background: var(--rule-2); color: var(--ink); }
.icon-btn:disabled { opacity: .3; cursor: default; }
.stack-actions { display: grid; gap: 8px; margin-top: 14px; }
.stack-actions .btn { width: 100%; }

.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 600;
  background: var(--rule-2); color: var(--ink-2); white-space: nowrap;
}
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-off { background: #eceaea; color: #8a8585; }

/* --- Tableaux ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--rule-2); vertical-align: middle; }
.table thead th { font: 600 13px/1.3 var(--font-din); color: var(--ink-3); border-bottom: 1px solid var(--rule); }
.table tbody tr:hover { background: #f6f7f5; }
.table a { font-weight: 600; text-decoration: none; }
.table .is-off td { color: var(--ink-3); }
.table-scroll { overflow-x: auto; }
.list-tools { display: flex; gap: 10px; margin-bottom: 12px; }
.search { max-width: 360px; }
.empty { color: var(--ink-2); padding: 18px 4px; }

.matrix th, .matrix td { text-align: center; }
.matrix tbody th { text-align: left; font-weight: 600; white-space: nowrap; }
.matrix thead th { vertical-align: bottom; min-width: 156px; }
.matrix thead th small { display: block; font: 400 12px var(--font-body); color: var(--ink-3); margin-top: 4px; }
.th-input { font: 600 13px var(--font-din); text-align: center; min-height: 32px; }
.level-select { min-height: 32px; padding: 4px 6px; font-size: 13px; }
.level { font-size: 13px; color: var(--ink-3); }
.level-M { color: var(--ok); font-weight: 600; }

.seq-table input { min-height: 34px; }
.w-prefix { width: 130px; font-family: var(--font-din); }
.w-num { width: 110px; }
.w-small { width: 72px; }
.seq-preview {
  display: inline-block; min-width: 120px; padding: 5px 10px; border-radius: var(--r-sm);
  background: var(--rail); color: #fff; font: 600 15px/1.3 var(--font-din); letter-spacing: .04em;
}

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: 14px; }
.facts dt { color: var(--ink-3); }
.facts dd { margin: 0; }

/* --- Menu principal ------------------------------------------------------ */
.home-head { margin: 4px 0 26px; }
.home-head h1 { font-size: 32px; }
.home-head p { margin: 4px 0 0; }
.tile-group { margin-bottom: 30px; }
.tile-group h2 { font-size: 15px; color: var(--ink-2); margin-bottom: 12px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.tile {
  position: relative; display: grid; grid-template-rows: auto auto 1fr; gap: 4px; min-height: 148px;
  padding: 18px 18px 16px 26px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--ink); text-decoration: none; overflow: hidden;
}
a.tile:hover { border-color: #b8bdb7; color: var(--ink); box-shadow: 0 4px 14px rgba(20, 30, 36, .08); }
a.tile:hover .tile-wire { width: 12px; }
.tile-wire { position: absolute; left: 0; top: 0; bottom: 0; width: 8px; background: var(--wire); transition: width .15s; }
.tile-visual { display: grid; place-items: center start; height: 44px; margin-bottom: 8px; color: var(--ink); }
.tile-visual img { width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); }
.tile-visual.small { height: 36px; margin: 0; }
.tile-visual.small img { width: 36px; height: 36px; }
.tile-label { font: 600 19px/1.2 var(--font-din); }
.tile-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.4; align-self: end; }
.tile.is-soon { background: #f6f7f4; border-style: dashed; }
.tile.is-soon .tile-visual, .tile.is-soon .tile-label { color: var(--ink-3); }
.tile.is-soon .tile-wire { opacity: .45; }

/* --- Paramètres ---------------------------------------------------------- */
.split { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 16px; align-items: start; }
.split-nav { padding: 10px 8px; position: sticky; top: calc(var(--topbar-h) + 16px); }
.split-group { margin: 12px 10px 4px; font: 600 12.5px/1.2 var(--font-din); color: var(--ink-3); }
.split-group:first-child { margin-top: 4px; }
.split-nav a {
  display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none; font-size: 14px;
}
.split-nav a small { color: var(--ink-3); font-family: var(--font-din); }
.split-nav a:hover { background: var(--rule-2); }
.split-nav a[aria-current="page"] { background: var(--action-soft); color: var(--action); font-weight: 600; }
.add-row { display: flex; gap: 8px; margin-bottom: 12px; }
.items { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule-2); }
.item {
  display: flex; align-items: center; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--rule-2); background: #fff;
}
.item.is-off .item-label { color: var(--ink-3); text-decoration: line-through; }
.item.is-dragging { opacity: .5; }
.item.drop-before { box-shadow: inset 0 3px 0 var(--action); }
.item.drop-after { box-shadow: inset 0 -3px 0 var(--action); }
.grip {
  width: 14px; height: 22px; flex: none; cursor: grab; opacity: .5;
  background: radial-gradient(circle, var(--ink-2) 1.2px, transparent 1.6px) 0 0 / 7px 7px;
}
.item-form { flex: 1; min-width: 0; margin: 0; }
.item-label { border-color: transparent; background: transparent; min-height: 34px; }
.item-label:hover { border-color: var(--rule); }
.item-actions { display: flex; align-items: center; gap: 2px; margin: 0; }
.items .is-saved { border-color: var(--ok); }

.image-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.image-row {
  position: relative; display: grid; grid-template-columns: 44px 160px 1fr; align-items: center; gap: 14px;
  padding: 10px 12px 10px 22px; border: 1px solid var(--rule-2); border-radius: var(--r); overflow: hidden;
}
.image-row .tile-wire { width: 6px; }
.image-form { display: flex; gap: 8px; align-items: center; margin: 0; }
.image-form input[type="file"] { max-width: 340px; }

/* --- Société ------------------------------------------------------------- */
.company { max-width: 1100px; }
.logos { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.logo-slot { display: grid; grid-template-columns: 160px 1fr; gap: 16px; align-items: start; }
.logo-slot input[type="file"] { margin-top: 6px; }
.logo-preview {
  display: grid; place-items: center; height: 100px; padding: 10px; border: 1px solid var(--rule); border-radius: var(--r);
  background: repeating-conic-gradient(#f3f4f2 0 25%, #fff 0 50%) 0 0 / 16px 16px;
}
.logo-preview img { max-width: 100%; max-height: 80px; object-fit: contain; }
.logo-preview.is-small { width: 100px; }
.addresses { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 16px; }
.address { margin: 0; padding: 14px 16px 16px; border: 1px solid var(--rule-2); border-radius: var(--r); min-width: 0; }
.address legend { padding: 0 6px; font: 600 14px var(--font-din); }
.address-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.a-street, .a-city { grid-column: span 3; }
.a-number, .a-zip { grid-column: span 1; }
.a-country { grid-column: 1 / -1; }
.sticky-actions {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 16px; padding: 12px 22px;
  margin: 0 -1px; background: rgba(255, 255, 255, .96); border: 1px solid var(--rule); border-radius: var(--r);
  box-shadow: 0 -4px 16px rgba(20, 30, 36, .06);
}

/* --- Connexion ----------------------------------------------------------- */
.auth {
  min-height: 100vh; display: grid; place-content: center; gap: 16px; padding: 24px 16px;
  background:
    linear-gradient(var(--bg), var(--bg)) padding-box,
    var(--bg);
}
.auth-card {
  width: min(400px, calc(100vw - 32px)); padding: 30px 30px 26px; background: var(--panel);
  border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 18px 50px rgba(20, 30, 36, .1);
}
.auth-brand { display: flex; align-items: center; gap: 10px; }
.auth-brand .brand-mark { background: var(--rail); color: #fff; width: 34px; height: 34px; font-size: 20px; }
.auth-brand-name { font: 600 22px/1 var(--font-din); }
.auth-brand-name span { color: var(--ink-3); font-weight: 400; }
.auth-wires { display: flex; gap: 4px; margin: 18px 0 22px; }
.auth-wires span { height: 5px; flex: 1; border-radius: 3px; background: var(--wire); }
.auth-wires .wire-pe { background: var(--pe); }
.auth-title { font-size: 22px; margin-bottom: 14px; }
.auth-foot { text-align: center; font-size: 12.5px; color: var(--ink-3); margin: 0; }

.steps { margin: 0; padding-left: 22px; display: grid; gap: 16px; }
.steps li::marker { font: 600 16px var(--font-din); color: var(--action); }
.steps p { margin: 0 0 8px; }
.qr { width: 200px; padding: 8px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r); }
.qr svg { display: block; width: 100%; height: auto; }
.key { font-size: 15px; letter-spacing: .06em; word-break: break-all; }
.temp-pass code { display: inline-block; padding: 10px 16px; font-size: 22px; letter-spacing: .06em; background: var(--rail); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips form { margin: 0; }
.chip { padding: 5px 10px; border: 1px solid var(--rule); border-radius: 14px; background: #fff; font: inherit; font-size: 13px; cursor: pointer; }
.chip:hover { border-color: var(--danger); color: var(--danger); }

.error-panel { margin: 40px auto; text-align: center; }
.error-code { font: 600 56px/1 var(--font-din); color: var(--ink-3); margin: 0 0 8px; }
.error-panel h1 { margin-bottom: 8px; }

/* --- Mobile -------------------------------------------------------------- */
@media (max-width: 900px) {
  .page { padding: 16px 16px 56px; }
  .app-head { margin: -16px -16px 16px; padding: 16px 16px 0 24px; }
  .sidebar {
    position: fixed; left: 0; top: var(--topbar-h); height: calc(100vh - var(--topbar-h));
    margin-left: 0; transform: translateX(0); transition: transform .2s ease; overflow-y: auto;
  }
  .nav-collapsed .sidebar { margin-left: 0; transform: translateX(-100%); }
  .scrim { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 20; background: rgba(20, 30, 36, .4); }
  .nav-collapsed .scrim { display: none; }
  /* sur mobile, les sous-menus s'ouvrent sous l'application touchée */
  .flyout { position: static; display: none; visibility: visible; opacity: 1; transform: none; box-shadow: none;
            border: 0; border-left: 3px solid var(--wire); border-radius: 0; margin: 0 12px 6px 22px; background: #2a353d; }
  .flyout-title { display: none; }
  .flyout a, .flyout-soon { color: var(--rail-ink); }
  .flyout a:hover { background: var(--rail-hover); }
  .nav-app.is-open > .flyout, .nav-app.is-current > .flyout { display: block; }
  .user-name, .brand-name { display: none; }
  .brand-logo { height: 18px; }
  .brand-version { font-size: 11px; }
  .split, .panel-grid-wide { grid-template-columns: 1fr; }
  .split-nav { position: static; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .addresses { grid-template-columns: 1fr; }
  .image-row { grid-template-columns: 40px 1fr; }
  .image-form { grid-column: 1 / -1; flex-wrap: wrap; }
  .logo-slot { grid-template-columns: 1fr; }
  .head-actions { margin-left: 0; width: 100%; flex-wrap: wrap; }
  .item { flex-wrap: wrap; }
  .item-actions { margin-left: 22px; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .tile { min-height: 128px; padding: 14px 14px 14px 22px; }
  .home-head h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

@media print {
  .topbar, .sidebar, .head-actions, .sticky-actions { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
}

/* Corrections après relecture visuelle */
.tile-wire.wire-pe, .app-wire.wire-pe, .wire.wire-pe { background: var(--pe); }
::placeholder { color: #aab2b6; opacity: 1; }
.logo-preview span { font-size: 13px; text-align: center; }

/* --- Employés ------------------------------------------------------------ */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
form.inline { display: inline; }
.emp-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; }
.emp-toolbar .search { flex: 0 1 320px; background: #fff; }
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chips a {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--rule);
  border-radius: 16px; background: #fff; color: var(--ink); font-size: 13.5px; text-decoration: none;
}
.filter-chips a small { color: var(--ink-3); font-family: var(--font-din); }
.filter-chips a:hover { border-color: var(--ink-3); }
.filter-chips a[aria-current="true"] { background: var(--rail); border-color: var(--rail); color: #fff; }
.filter-chips a[aria-current="true"] small { color: var(--rail-ink); }
.view-switch { display: flex; margin-left: auto; border: 1px solid var(--rule); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.view-switch button { display: grid; place-items: center; width: 38px; height: 34px; border: 0; background: none; color: var(--ink-3); cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: var(--rule-2); color: var(--ink); }

.emp-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.emp-card {
  display: grid; grid-template-columns: 96px 1fr; min-height: 132px; overflow: hidden;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); color: var(--ink); text-decoration: none;
}
.emp-card:hover { border-color: #b8bdb7; color: var(--ink); box-shadow: 0 4px 14px rgba(20, 30, 36, .08); }
.emp-card .emp-photo { width: 96px; height: 100%; min-height: 132px; border-radius: 0; }
.emp-card-body { display: flex; flex-direction: column; gap: 1px; padding: 12px 14px; min-width: 0; border-left: 4px solid var(--wire, #8a5a34); }
.emp-name { font: 600 16.5px/1.25 var(--font-din); }
.emp-fn { font-size: 13.5px; color: var(--ink-2); margin-bottom: 4px; }
.emp-line { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.emp-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding-top: 6px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 10px; background: #f1e9e2; color: #6d4527; font-size: 12px; font-weight: 600; text-decoration: none; }
.tag-quiet { background: var(--rule-2); color: var(--ink-2); font-weight: 400; }
.tag-end { background: var(--danger-soft); color: var(--danger); }
a.tag:hover { background: #e7d8cb; color: #6d4527; }
.emp-photo { display: block; width: 44px; height: 44px; object-fit: cover; border-radius: var(--r-sm); background: #e9e1d9; }
.emp-initials { display: grid; place-items: center; color: #8a5a34; font: 600 26px/1 var(--font-din); letter-spacing: .03em; }
.emp-photo.is-mini { width: 32px; height: 32px; font-size: 13px; border-radius: 50%; }
.cell-photo { width: 44px; }
.emp-photo.is-large { width: 132px; height: 132px; font-size: 44px; border-radius: var(--r); }
.list-foot { margin-top: 14px; font-size: 14px; }
.empty-state { text-align: center; padding: 40px 22px; }
.empty-state .actions { justify-content: center; }

.emp-head { display: grid; grid-template-columns: auto 1fr auto; gap: 24px; align-items: start; }
.emp-head-photo { display: grid; gap: 6px; justify-items: center; width: 132px; }
.photo-btn { cursor: pointer; width: 100%; }
.emp-number { margin: 0 0 2px; font-size: 13px; color: var(--ink-3); }
.emp-title { font-size: 30px; }
.emp-sub { margin: 2px 0 12px; color: var(--ink-2); }
.emp-quick { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; font-size: 14px; }
.emp-quick dt { font-size: 12px; color: var(--ink-3); }
.emp-quick dd { margin: 0; }
.emp-quick a { text-decoration: none; }

.tabs { display: flex; gap: 2px; margin: 0 0 -1px 2px; position: relative; z-index: 1; }
.tabs a {
  display: inline-flex; align-items: center; gap: 6px; padding: 10px 18px; border: 1px solid transparent; border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0; color: var(--ink-2); text-decoration: none; font-size: 14.5px;
}
.tabs a small { color: var(--ink-3); font-family: var(--font-din); }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-selected="true"] { background: var(--panel); border-color: var(--rule); color: var(--ink); font-weight: 600; box-shadow: inset 0 3px 0 #8a5a34; }
.tab-panel { border-top-left-radius: 0; }
.form-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 40px; margin-bottom: 14px; }
.h-gap { margin-top: 22px; }
.form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
textarea { resize: vertical; min-height: 76px; line-height: 1.45; }
select:disabled { background-color: var(--bg); color: var(--ink-2); opacity: 1; }
.team { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.private-note {
  display: flex; gap: 8px; align-items: flex-start; margin: 0 0 18px; padding: 10px 14px; border-radius: var(--r);
  background: #f4efe9; color: #6d4527; font-size: 13.5px;
}
.private-note svg { flex: none; margin-top: 2px; }
.secret { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 16px; letter-spacing: .06em; }
.idcard { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 38px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--rule);
  border-radius: var(--r-sm); background: #fff; color: var(--ink); text-decoration: none; font-size: 14px;
}
.file-chip:hover { border-color: var(--action); color: var(--action); }

.dropzone-form { margin-bottom: 18px; }
.dropzone {
  display: grid; justify-items: center; gap: 4px; padding: 26px 16px; text-align: center; cursor: pointer;
  border: 2px dashed #c3c8c2; border-radius: var(--r); background: var(--bg); color: var(--ink-2);
}
.dropzone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone:hover, .dropzone.is-over { border-color: var(--action); background: var(--action-soft); color: var(--action); }
.dropzone:focus-within { box-shadow: var(--focus); }
.dropzone strong { color: var(--ink); font-size: 15px; }
.pending-files { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.pending-files li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.docs td { vertical-align: middle; }

.import-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.import-summary > div { display: grid; min-width: 130px; padding: 12px 16px; border: 1px solid var(--rule-2); border-radius: var(--r); }
.import-summary .big { font-size: 30px; font-weight: 600; line-height: 1.1; }
.import-summary span:last-child { font-size: 13px; color: var(--ink-2); }
.import-summary .is-warn { border-color: #ecd6a6; background: var(--warn-soft); }
.import-summary .is-error { border-color: #e2b4ae; background: var(--danger-soft); }
.warn-line { display: block; font-size: 13px; color: var(--warn); }
.warn-line::before { content: "• "; }
.import-form { margin: 18px 0 10px; }

@media (max-width: 900px) {
  .emp-cards { grid-template-columns: 1fr; }
  .view-switch { margin-left: 0; }
  .emp-toolbar .search { flex: 1 1 100%; }
  .emp-head { grid-template-columns: 1fr; justify-items: start; gap: 14px; }
  .emp-head-photo { grid-template-columns: auto auto; width: auto; align-items: center; }
  .emp-head-photo .emp-photo { grid-row: span 2; width: 88px; height: 88px; }
  .emp-title { font-size: 24px; }
  .form-cols, .form-grid-3 { grid-template-columns: 1fr; }
  .tabs a { padding: 9px 12px; }
  .pending-files li { grid-template-columns: 1fr; gap: 2px; }
}

/* Retouches Employés */
.field { align-content: start; }
@media (max-width: 900px) {
  .emp-card { grid-template-columns: 76px 1fr; }
  .emp-card .emp-photo { width: 76px; font-size: 22px; }
}

/* Statut actif / inactif */
.segmented { display: flex; border: 1px solid var(--rule); border-radius: var(--r-sm); background: #fff; overflow: hidden; }
.segmented a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; color: var(--ink-2); text-decoration: none; font-size: 14px; border-left: 1px solid var(--rule); }
.segmented a:first-child { border-left: 0; }
.segmented a small { color: var(--ink-3); font-family: var(--font-din); }
.segmented a:hover { color: var(--ink); background: var(--rule-2); }
.segmented a[aria-current="true"] { background: var(--action); color: #fff; font-weight: 600; }
.segmented a[aria-current="true"] small { color: #d6e3f3; }
.tag-off { background: #eceaea; color: #6b6767; }
.emp-card.is-inactive { opacity: .72; }
.emp-card.is-inactive .emp-photo { filter: grayscale(1); }
.active-check { padding: 8px 12px; background: var(--bg); border-radius: var(--r-sm); }

/* --- Organigramme -------------------------------------------------------- */
.org-intro { margin: 0 0 16px; }
.org-scroll {
  overflow-x: auto; padding: 24px 12px 28px; margin-bottom: 16px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r);
}
.org-scroll > .org-tree + .org-tree { margin-top: 40px; padding-top: 32px; border-top: 1px dashed var(--rule); }
.org-tree, .org-tree ul { display: flex; justify-content: center; margin: 0; padding: 0; list-style: none; }
.org-tree { min-width: max-content; }
.org-tree ul { position: relative; padding-top: 22px; }
.org-tree li { position: relative; display: flex; flex-direction: column; align-items: center; padding: 22px 7px 0; }
.org-tree > li { padding-top: 0; }
/* traits : comme un schéma unifilaire, du responsable vers son équipe */
.org-tree li::before, .org-tree li::after {
  content: ""; position: absolute; top: 0; width: 50%; height: 22px; border-top: 1.5px solid #9aa3a8;
}
.org-tree li::before { right: 50%; }
.org-tree li::after { left: 50%; border-left: 1.5px solid #9aa3a8; }
.org-tree > li::before, .org-tree > li::after { display: none; }
.org-tree li:only-child::before { display: none; }
.org-tree li:only-child::after { border-top: 0; }
.org-tree li:first-child::before, .org-tree li:last-child::after { border-top: 0; }
.org-tree li:last-child::before { border-right: 1.5px solid #9aa3a8; border-radius: 0 6px 0 0; }
.org-tree li:last-child:not(:only-child)::after { border-left: 0; }
.org-tree li:first-child:not(:only-child)::after { border-radius: 6px 0 0 0; }
.org-tree ul::before { content: ""; position: absolute; top: 0; left: 50%; height: 22px; border-left: 1.5px solid #9aa3a8; }

.org-node {
  display: flex; align-items: center; gap: 10px; width: 216px; padding: 10px 12px; text-align: left;
  background: #fff; border: 1px solid var(--rule); border-top: 4px solid #8a5a34; border-radius: var(--r);
  color: var(--ink); text-decoration: none; position: relative; z-index: 1;
}
.org-node:hover { border-color: #b8bdb7; border-top-color: #8a5a34; color: var(--ink); box-shadow: 0 4px 14px rgba(20, 30, 36, .1); }
.org-tree > li > .org-node { border-top-color: var(--rail); background: #fbfbfa; }
.org-photo { width: 42px; height: 42px; flex: none; border-radius: 50%; font-size: 15px; }
.org-text { display: grid; gap: 1px; min-width: 0; }
.org-text strong { font: 600 14.5px/1.25 var(--font-din); }
.org-text span { font-size: 12.5px; color: var(--ink-2); line-height: 1.3; }
.org-text small { font-size: 11.5px; color: var(--ink-3); }
.org-alone-list { display: flex; flex-wrap: wrap; gap: 10px; }

@media (max-width: 900px) {
  /* sur GSM : liste en retrait, plus lisible qu'un grand arbre */
  .org-scroll { padding: 14px; }
  .org-tree, .org-tree ul { display: block; min-width: 0; }
  .org-tree ul { padding: 0 0 0 18px; margin-left: 20px; border-left: 1.5px solid #c3c8c2; }
  .org-tree li { display: block; padding: 8px 0 0; }
  .org-tree li::before, .org-tree li::after, .org-tree ul::before { display: none; }
  .org-node { width: 100%; }
}

@media print {
  .org-scroll { overflow: visible; border: 0; padding: 0; }
  .org-intro, .org-alone p { display: none; }
  .org-node { break-inside: avoid; box-shadow: none; }
  .app-head { margin: 0 0 12px; padding: 0; border: 0; }
  .app-tabs, .app-wire { display: none; }
  .flash { display: none; }
}
/* Organigramme plus compact + impression en paysage */
.org-tree { margin: 0 auto; }
.org-tree li { padding-left: 5px; padding-right: 5px; }
.org-node { width: 192px; padding: 9px 10px; gap: 9px; }
.org-photo { width: 38px; height: 38px; font-size: 14px; }
@page orgpage { size: A4 landscape; margin: 10mm; }
@media print { .org-scroll { page: orgpage; zoom: .8; } }
@media (max-width: 900px) { .org-node { width: 100%; } }

/* --- Tiers --------------------------------------------------------------- */
.panel-flush { padding: 6px 8px; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.plain-link { color: var(--ink); text-decoration: none; font-weight: 400 !important; }
.plain-link:hover { color: var(--action); text-decoration: underline; }
.push-right { margin-left: auto; }
.ok-text { color: var(--ok) !important; }
.tag-blue { background: #e3ecf7; color: #24548e; margin-left: 4px; font-weight: 500; }
.tag-filter select, .company-filter select { min-height: 34px; background-color: #fff; }
.company-filter .field-inline { gap: 8px; }
.company-filter select { min-width: 240px; }

.role { display: inline-block; margin-right: 4px; padding: 1px 8px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.role-client { background: #e3ecf7; color: #24548e; }
.role-supplier { background: #efe9f6; color: #5a3d80; }
.count-link { display: inline-block; min-width: 22px; text-align: center; color: var(--ink-2); text-decoration: none; font-family: var(--font-din); }
.count-link:hover { color: var(--action); }
.add-btn { display: inline-grid; place-items: center; text-decoration: none; font-size: 18px; line-height: 1; color: var(--action); border-color: var(--rule); }
.add-btn:hover { background: var(--action-soft) !important; color: var(--action) !important; }

.partner-logo { display: grid; place-items: center; width: 120px; height: 120px; object-fit: contain; padding: 8px;
  background: #fff; border: 1px solid var(--rule); border-radius: var(--r); }
.partner-initial { background: #e8eef6; color: #2c64a8; font: 600 46px/1 var(--font-din); border-color: transparent; }
.partner-logo.is-mini { width: 32px; height: 32px; padding: 2px; font-size: 15px; border-radius: var(--r-sm); }

.vat-lookup { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 18px; border-left: 4px solid #2c64a8; }
.vat-lookup input { width: 220px; font-family: var(--font-din); letter-spacing: .03em; }

.tiers-head { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(240px, auto); gap: 22px; align-items: start; }
.tiers-logo { display: grid; gap: 6px; justify-items: center; width: 120px; }
.tiers-logo label.btn { width: 100%; cursor: pointer; }
.radio-row { display: flex; gap: 18px; margin-bottom: 4px; }
.name-field input {
  border-color: transparent; background: transparent; padding: 2px 6px; margin-left: -6px; min-height: 0;
  font: 600 30px/1.2 var(--font-din); color: var(--ink);
}
.name-field input:hover:not([readonly]) { border-color: var(--rule); }
.name-field input:focus { background: #fff; }
.contact-lines { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.icon-field { display: flex; align-items: center; gap: 6px; color: var(--ink-3); }
.icon-field input { border-color: transparent; background: transparent; min-height: 32px; padding: 4px 6px; width: 230px; }
.icon-field input:hover:not([readonly]) { border-color: var(--rule); }
.icon-field input:focus { background: #fff; }
.tiers-side { display: grid; gap: 14px; justify-items: stretch; }
.roles { display: grid; gap: 6px; }
.role-check { display: flex; align-items: center; gap: 8px; padding: 7px 12px; border: 1px solid var(--rule); border-radius: var(--r-sm); cursor: pointer; font-weight: 600; }
.role-check small { margin-left: auto; color: var(--ink-3); font-weight: 400; }
.role-check:has(input:checked) { background: var(--action-soft); border-color: #b9cde6; }
.balance { display: grid; gap: 2px; margin: 0; padding: 12px 14px; border-radius: var(--r); background: var(--rail); color: #fff; }
.balance > div { display: grid; grid-template-columns: 1fr auto; align-items: baseline; gap: 0 12px; padding: 3px 0; }
.balance dt { font-size: 13px; color: var(--rail-ink); }
.balance dd { margin: 0; font-size: 18px; font-weight: 600; text-align: right; }
.balance dd.late { grid-column: 1 / -1; font-size: 12px; font-weight: 400; color: #f2b3ab; text-align: right; }
.balance .net { border-top: 1px solid #3a4852; margin-top: 4px; padding-top: 7px; }
.balance .net dd { color: #e6c619; }
.input-action { display: flex; gap: 6px; }
.input-action input { flex: 1; min-width: 0; }
.radio-field { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.radio-field > span { flex-basis: 100%; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.peppol-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.contact-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.contact-card { display: grid; grid-template-columns: 40px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--rule); border-radius: var(--r);
  color: var(--ink); text-decoration: none; }
.contact-card:hover { border-color: #b8bdb7; color: var(--ink); box-shadow: 0 3px 10px rgba(20, 30, 36, .07); }
.contact-card > span:last-child { display: grid; gap: 1px; min-width: 0; }
.contact-card .small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contact-card.is-inactive { opacity: .6; }
.avatar-round { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: #e8eef6; color: #2c64a8; font: 600 14px/1 var(--font-din); }
.contact-panel { max-width: 760px; }

.address-list, .bank-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 6px; }
.address-list li, .bank-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; padding: 9px 12px; border: 1px solid var(--rule-2); border-radius: var(--r-sm); }
.address-list li form, .bank-list li form { margin: 0 0 0 auto; }
.add-block > summary { list-style: none; display: inline-flex; }
.add-block > summary::-webkit-details-marker { display: none; }
.add-block[open] > summary { margin-bottom: 12px; }
.add-form { padding: 14px; background: var(--bg); border-radius: var(--r); }

@media (max-width: 900px) {
  .tiers-head { grid-template-columns: 1fr; }
  .tiers-logo { grid-template-columns: auto auto auto; width: auto; justify-items: start; align-items: center; }
  .tiers-logo .partner-logo { width: 72px; height: 72px; font-size: 30px; }
  .name-field input { font-size: 24px; }
  .icon-field input { width: 100%; }
  .contact-lines { display: grid; }
  .company-filter select { min-width: 0; width: 100%; }
  .company-filter .field-inline { flex-wrap: wrap; }
}
/* Retouches Tiers */
input[type="radio"] { width: 16px; height: 16px; min-height: 0; padding: 0; accent-color: var(--action); }
.tabs a[aria-selected="true"] { box-shadow: inset 0 3px 0 var(--wire, #8a5a34); }
/* Tiers : personnes, initiales */
.partner-initial { font-size: 34px; letter-spacing: .04em; }
.partner-initial.is-person { background: #eef2e8; color: #4d6b2e; }
.partner-logo.is-mini.partner-initial { font-size: 10.5px; letter-spacing: 0; }
.person-names { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.person-names .name-field input { width: 100%; }
.person-kind { margin: 8px 0 6px; padding: 10px 12px; background: var(--bg); border-radius: var(--r-sm); }
.person-kind .employer { margin-top: 10px; max-width: 420px; }
.tiers-logo label.btn.has-error { border-color: var(--danger); }
@media (max-width: 900px) { .person-names { grid-template-columns: 1fr; } }

/* --- Listes : sélection, colonnes, actions -------------------------------- */
.toolbar-end { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.toolbar-end .view-switch { margin-left: 0; }
.col-chooser > summary { list-style: none; display: inline-flex; gap: 6px; background: #fff; }
.col-chooser > summary::-webkit-details-marker { display: none; }
.col-panel { min-width: 250px; max-height: 60vh; overflow-y: auto; }
.col-option { display: flex; width: 100%; padding: 5px 10px; border-radius: var(--r-sm); font-size: 14px; }
.col-option:hover { background: var(--action-soft); }
.col-panel .btn { margin: 6px 4px 2px; }
.cell-check { width: 36px; padding-right: 0 !important; }
.cell-check input, .card-check input { width: 17px; height: 17px; cursor: pointer; }
.datatable tr.is-selected td { background: var(--action-soft); }
.datatable td[hidden], .datatable th[hidden] { display: none; }

.emp-card { position: relative; display: block; padding: 0; }
.emp-card-link { display: grid; grid-template-columns: 96px 1fr; min-height: 132px; height: 100%; color: var(--ink); text-decoration: none; }
.emp-card-link:hover { color: var(--ink); }
.card-check { position: absolute; top: 8px; right: 8px; z-index: 2; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--r-sm); background: rgba(255, 255, 255, .9); cursor: pointer; opacity: 0; transition: opacity .12s; }
.emp-card:hover .card-check, .card-check:focus-within, .emp-card.is-selected .card-check, .has-selection .card-check { opacity: 1; }
.emp-card.is-selected { border-color: var(--action); box-shadow: 0 0 0 2px var(--action-soft); }

.action-bar {
  position: sticky; bottom: 12px; z-index: 25; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px; padding: 10px 14px; background: var(--rail); color: #fff; border-radius: var(--r);
  box-shadow: 0 10px 30px rgba(20, 30, 36, .28);
}
.action-bar .btn { background: #fff; }
.action-bar .btn-quiet { background: transparent; color: var(--rail-ink); }
.action-bar .btn-quiet:hover { background: var(--rail-hover); color: #fff; }
.action-bar .btn-danger { background: #fff; }
.action-bar .btn-danger { margin-left: auto; }
.sel-count { font-size: 14px; }
.sel-count strong { font: 600 18px var(--font-din); }
.action-sep { width: 1px; height: 22px; background: #3a4852; margin: 0 4px; }
.drop-up > summary { list-style: none; }
.drop-up > summary::-webkit-details-marker { display: none; }
.drop-up .drop-panel { top: auto; bottom: calc(100% + 8px); left: 0; right: auto; }
.export-panel { width: min(560px, 90vw); }
.export-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); max-height: 46vh; overflow-y: auto; }
.export-foot { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 8px 6px 2px; border-top: 1px solid var(--rule-2); margin-top: 6px; }
.export-foot .btn-primary { margin-left: auto; }
.print-panel { width: min(420px, 90vw); }
.action-bar .drop-panel .btn-quiet { color: var(--ink-2); }
@media (max-width: 900px) {
  .toolbar-end { margin-left: 0; }
  .export-cols { grid-template-columns: 1fr; }
  .action-bar .btn-danger { margin-left: 0; }
  .card-check { opacity: 1; }
  .emp-card-link { grid-template-columns: 76px 1fr; }
}
@media print { .action-bar, .cell-check, .card-check, .col-chooser { display: none !important; } }

.action-bar .btn-primary { background: var(--action); border-color: var(--action); color: #fff; }
.action-bar .btn-primary:hover { background: #24548e; color: #fff; }

/* Fenêtres Exporter / Imprimer : centrées et toujours entièrement visibles */
.action-bar .drop-up .drop-panel {
  position: fixed; left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); z-index: 60;
  display: flex; flex-direction: column; max-height: min(640px, calc(100vh - 48px));
  box-shadow: 0 0 0 100vmax rgba(20, 30, 36, .38), 0 18px 50px rgba(20, 30, 36, .3);
  padding: 8px 10px 10px;
}
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 6px;
  border-bottom: 1px solid var(--rule-2); margin-bottom: 6px; }
.modal-head .drop-title { margin: 4px 6px; font-size: 15px; color: var(--ink); }
.modal-head .icon-btn { font-size: 20px; }
.export-cols { flex: 1 1 auto; min-height: 0; max-height: none; overflow-y: auto; }
.export-foot { flex: none; }
.action-bar:has(details[open]) { z-index: 70; }

/* Prestations : jours du suivi automatique */
.day-checks { flex-wrap: wrap; }

/* --- Produits, projets, achats, stock ------------------------------------- */
.badge-info { background: var(--action-soft); color: var(--action); }
.badge-lg { padding: 5px 12px; font-size: 13px; border-radius: 12px; }
.warn-text { color: var(--warn); }
.small-title { margin: 0 0 6px; font: 600 13.5px/1.3 var(--font-din); color: var(--ink-2); }
.form-grid.pair { gap: 14px 12px; }
.kind-row { display: flex; flex-wrap: wrap; gap: 6px 18px; }
fieldset.field { border: 0; padding: 0; margin: 0; }

.project-strip { padding: 12px 18px; }
.strip { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 0; }
.strip dt { font-size: 12px; color: var(--ink-3); }
.strip dd { margin: 2px 0 0; font-weight: 600; }
.strip a { text-decoration: none; }

.table-compact { font-size: 13px; }
.table-compact th, .table-compact td { padding: 6px 8px; }
.table tfoot th { border-top: 1px solid var(--rule); border-bottom: 0; font-weight: 600; }
.listing-table .section-row th {
  background: var(--bg); font: 600 13px/1.3 var(--font-din); color: var(--ink-2); padding: 7px 10px;
  border-left: 3px solid var(--wire, var(--rail));
}
.listing-table td { vertical-align: top; }
.table tr.is-late td { background: #fdf4f2; }
.table tr.is-low td { background: #fdf8ec; }
.status-summary { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }

.qty-input { width: 96px; min-height: 32px; padding: 4px 8px; text-align: right; font-family: var(--font-din); }
.add-line { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: flex-end; }
.add-line .field.grow { flex: 1 1 260px; }
.add-line .w-qty { flex: 0 0 110px; }
.add-line .w-mid { flex: 0 1 170px; }
.add-line .check { flex: 1 1 100%; }
.sub-panel { border: 1px solid var(--rule-2); border-radius: var(--r); padding: 10px 14px; background: #fafbf9; }
.sub-panel > summary { cursor: pointer; font-weight: 600; color: var(--ink-2); }
.sub-panel[open] > summary { margin-bottom: 12px; }

.order-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.order-row form { margin: 0 0 0 auto; }
.inline-actions { display: contents; }
.panel-head.pad { padding: 14px 18px 0; }
.inline-select select { min-height: 32px; padding: 4px 8px; }

@media (max-width: 900px) {
  .strip { gap: 8px 20px; }
  .add-line .w-qty, .add-line .w-mid { flex: 1 1 45%; }
}
.table .right, .table th.right { text-align: right; }
.listing-table td:nth-child(2) { min-width: 210px; }
.listing-table td, .listing-table th { padding-left: 8px; padding-right: 8px; }
.edit-link { display: inline-grid; place-items: center; text-decoration: none; }
.small-title.h-gap { margin-top: 22px; }

.strong-num { font-size: 17px; font-weight: 600; }

/* Photo produit */
.prod-thumb { display: block; width: 36px; height: 36px; object-fit: contain; background: #fff; border: 1px solid var(--rule-2); border-radius: var(--r-sm); }
.prod-thumb.is-empty { background: repeating-linear-gradient(135deg, #f3f4f2 0 4px, #fff 4px 8px); }
.prod-photo { display: grid; place-items: center; height: 200px; margin-bottom: 10px; border: 1px solid var(--rule); border-radius: var(--r);
  background: repeating-conic-gradient(#f3f4f2 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.prod-photo img { max-width: 100%; max-height: 190px; object-fit: contain; }

/* Carte de la zone de pointage */
.zone-map { border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; background: var(--soft, #f3f4f2); }
.zone-map-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; padding: 8px 10px; background: #fff; border-bottom: 1px solid var(--rule); }
.zone-map-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.zone-map-frame { display: block; width: 100%; height: 340px; border: 0; background: #eceeea; }
.zone-map > p { margin: 0; padding: 8px 10px; }

/* --- Offres ------------------------------------------------------------------ */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.center, .table .center { text-align: center; }
.panel-pad { padding: 12px 14px; }
.panel-flush > .panel-head.panel-pad { margin-bottom: 0; flex-wrap: wrap; }
.btn-ok { border-color: var(--ok); color: var(--ok); }
.btn-ok:hover { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.send-panel { min-width: 340px; }
.send-panel form { margin: 0; }
.check-list { display: grid; gap: 8px; margin: 14px 0 0; padding: 0; border: 0; }
.check-list legend { padding: 0; margin-bottom: 6px; }
.offer-status { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
.offer-status .actions { margin-top: 6px; }
.offer-status .inline-form { margin-top: 10px; align-items: flex-end; }
.offer-top { margin-bottom: 16px; }
.offer-text { width: 100%; font-size: 14.5px; line-height: 1.55; }

.offer-lines { min-width: 980px; }
.offer-lines td { vertical-align: top; padding: 6px 6px; }
.offer-lines thead th { padding: 8px 6px; }
.offer-lines input, .offer-lines textarea { padding: 6px 7px; font-size: 13.5px; }
.offer-lines textarea { min-height: 34px; width: 100%; resize: vertical; field-sizing: content; max-height: 220px; }
.offer-lines .cell-move { width: 58px; white-space: nowrap; }
.offer-lines .cell-move .icon-btn { width: 24px; height: 28px; font-size: 14px; }
.offer-lines .cell-desc { min-width: 320px; }
.offer-lines .cell-desc .prod-thumb { float: left; margin: 0 8px 0 0; }
.offer-lines .in-ref { width: 104px; }
.offer-lines .in-unit { width: 64px; }
.offer-lines .in-num { width: 78px; text-align: right; font-variant-numeric: tabular-nums; }
.offer-lines .in-price { width: 96px; }
.offer-lines .in-disc { width: 60px; }
.offer-lines td small.muted { display: block; margin-top: 3px; }
.offer-lines [data-line-total] { padding-top: 13px; font-weight: 600; }
.offer-lines .center input { margin-top: 9px; width: 17px; height: 17px; }
.offer-lines .cell-print { white-space: nowrap; padding-top: 6px; }
.print-opt { display: flex; align-items: center; gap: 5px; font-size: 12.5px; line-height: 1.2; color: var(--ink-2); margin: 2px 0; cursor: pointer; }
.print-opt input { width: 15px; height: 15px; margin: 0; }
.offer-lines tr.is-hidden-ref .in-ref { color: var(--ink-3); text-decoration: line-through; }
.offer-lines tr.is-hidden-price .in-price, .offer-lines tr.is-hidden-price .in-disc, .offer-lines tr.is-hidden-price [data-line-total] { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(122, 134, 141, .5); }
.ol-kind { display: block; margin: 0 0 3px; font: 600 12px/1.2 var(--font-din); color: var(--ink-3); }
.offer-lines tr.ol-titre td { background: #f3f4f2; border-top: 1px solid var(--rule); }
.offer-lines .in-title { font-weight: 600; font-size: 14.5px; }
.offer-lines tr.ol-texte .in-desc { font-style: italic; color: var(--ink-2); }
.offer-lines tr.is-hidden-line td { background: repeating-linear-gradient(135deg, #fbfbfa 0 6px, #f4f5f3 6px 12px); }
.offer-lines tr.is-hidden-line .in-desc, .offer-lines tr.is-hidden-line [data-line-total] { color: var(--ink-3); text-decoration: line-through; text-decoration-color: rgba(122, 134, 141, .5); }
.offer-add { border-top: 1px solid var(--rule-2); }

.offer-totals { display: flex; flex-direction: column; align-items: flex-end; border-top: 1px solid var(--rule); }
.offer-totals dl { display: grid; gap: 0; min-width: 330px; margin: 0; }
.offer-totals dl > div { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 6px 2px; border-bottom: 1px solid var(--rule-2); }
.offer-totals dt { color: var(--ink-2); }
.offer-totals dd { margin: 0; display: flex; align-items: center; gap: 10px; font-variant-numeric: tabular-nums; }
.offer-totals .is-strong dd, .offer-totals .is-strong dt { font-weight: 600; color: var(--ink); }
.offer-totals .is-total { margin-top: 4px; padding: 9px 10px; background: var(--rail, #222c33); color: #fff; border-radius: var(--r-sm); border: 0; }
.offer-totals .is-total dt { color: #fff; font-weight: 600; }
.offer-totals .is-total dd { font-size: 17px; font-weight: 700; }
.offer-totals > p { margin: 6px 0 0; }
.offer-texts .form-grid textarea { width: 100%; }
@media (max-width: 760px) { .offer-totals dl { min-width: 0; width: 100%; } .send-panel { min-width: 0; } }

/* Paramètres : TVA et conditions générales */
.vat-table td { vertical-align: top; }
.vat-table input[name$="label"] { width: 100%; min-width: 220px; }
.vat-table textarea { width: 100%; min-width: 300px; font-size: 13.5px; }
.vat-table .center input { margin-top: 9px; }
.cgv-text { width: 100%; font-size: 14px; line-height: 1.5; }

/* --- Agenda ------------------------------------------------------------------- */
.ag-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin-bottom: 14px; }
.ag-nav { display: flex; align-items: center; gap: 6px; margin-right: auto; }
.ag-nav .btn-small { min-width: 34px; justify-content: center; }
.ag-title { margin: 0 0 0 8px; font-size: 19px; font-weight: 600; }
.ag-who select { min-width: 210px; }
.ag-week { --ag-h: 44px; --ag-q: 11px; --ag-gut: 58px; background: #fff; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.ag-row { display: grid; grid-template-columns: var(--ag-gut) repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .62fr)); }
.ag-week.is-day .ag-row { grid-template-columns: var(--ag-gut) minmax(0, 1fr); }
.ag-head { border-bottom: 1px solid var(--rule); }
.ag-dayhead { display: flex; align-items: baseline; gap: 6px; padding: 8px 10px; color: var(--ink-2); text-decoration: none; border-left: 1px solid var(--rule-2); }
.ag-dayhead:hover { background: #f7f8f6; }
.ag-dname { font-size: 13px; text-transform: capitalize; }
.ag-dnum { font-size: 19px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.ag-dayhead.is-today .ag-dnum { color: #fff; background: #c49a1a; border-radius: 999px; min-width: 30px; text-align: center; padding: 0 6px; }
.ag-dayhead.is-today .ag-dname { color: #8a6a0c; font-weight: 600; }
.ag-gutter { display: flex; justify-content: flex-end; padding: 4px 8px 0 0; font-size: 11.5px; color: var(--ink-3); }
.ag-allday { border-bottom: 1px solid var(--rule); background: #fafaf8; }
.ag-allday .ag-gutter { align-items: center; padding-top: 0; }
.ag-alldaycell { display: flex; flex-direction: column; gap: 3px; padding: 4px; min-height: 30px; border-left: 1px solid var(--rule-2); }
.ag-scroll { height: clamp(380px, calc(100vh - 330px), 760px); overflow-y: auto; overscroll-behavior: contain; }
.ag-body { position: relative; }
.ag-hours { flex-direction: column; justify-content: flex-start; padding: 0 8px 0 0; }
.ag-hour { display: block; height: var(--ag-h); line-height: 1; transform: translateY(-5px); text-align: right; font-variant-numeric: tabular-nums; }
.ag-hour:first-child { visibility: hidden; }
.ag-day { position: relative; border-left: 1px solid var(--rule-2); }
.ag-day.is-today { background: #fffcf1; }
.ag-day.is-weekend, .ag-alldaycell.is-weekend, .ag-dayhead.is-weekend { background: #f8f8f6; }
.ag-slot { display: block; height: var(--ag-h); border-bottom: 1px solid #eef0ec; }
.ag-slot:nth-child(n+8):nth-child(-n+19) { background: rgba(255, 255, 255, .55); }
a.ag-slot:hover { background: rgba(196, 154, 26, .09); }
.ag-ev { position: absolute; overflow: hidden; display: flex; flex-direction: column; gap: 1px; padding: 3px 6px 3px 7px;
  background: #fbf2d6; border-left: 3px solid #c49a1a; border-radius: 3px; color: var(--ink); text-decoration: none; font-size: 12.5px; line-height: 1.25;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .9); z-index: 1; }
.ag-ev:hover, .ag-ev:focus-visible { z-index: 3; box-shadow: 0 0 0 1px #fff, 0 2px 8px rgba(30, 41, 48, .18); }
.ag-ev-title { font-weight: 600; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
.ag-ev.is-mid .ag-ev-title { display: block; white-space: nowrap; text-overflow: ellipsis; }
.ag-ev-meta { color: var(--ink-2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-ev.is-short { flex-direction: row; align-items: center; gap: 6px; padding-top: 1px; padding-bottom: 1px; white-space: nowrap; }
.ag-ev.is-short .ag-ev-title { white-space: nowrap; }
.ag-ev.is-project { background: #e8ecee; border-left-color: #1e2328; }
.ag-ev.is-free { background: repeating-linear-gradient(135deg, #fbf8ee 0 5px, #fff 5px 10px); }
.ag-ev.is-tentative { border-left-style: dashed; }
.ag-ev.is-pending, .ag-chip.is-pending { outline: 1.5px dashed #b5372b; outline-offset: -1.5px; }
.ag-now { position: absolute; left: 0; right: 0; height: 0; border-top: 2px solid #b5372b; z-index: 4; pointer-events: none; }
.ag-now::before { content: ""; position: absolute; left: -5px; top: -6px; width: 10px; height: 10px; border-radius: 50%; background: #b5372b; }
.ag-chip { display: block; padding: 2px 6px; border-left: 3px solid #c49a1a; background: #fbf2d6; border-radius: 3px; color: var(--ink);
  text-decoration: none; font-size: 12.5px; line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ag-chip + .ag-chip { margin-top: 3px; }
.ag-chip.is-free { background: repeating-linear-gradient(135deg, #fbf8ee 0 5px, #fff 5px 10px); }
.ag-time { font-variant-numeric: tabular-nums; color: var(--ink-2); }
.ag-proj { color: var(--ink-3); font-size: 11.5px; }
.ag-legend { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.ag-key { display: inline-block; width: 14px; height: 12px; border-radius: 2px; margin-left: 10px; background: #fbf2d6; border-left: 3px solid #c49a1a; }
.ag-key.is-project { background: #e8ecee; border-left-color: #1e2328; }
.ag-key.is-pending { outline: 1.5px dashed #b5372b; outline-offset: -1.5px; }
.ag-team { min-width: 900px; table-layout: fixed; }
.ag-team th:first-child { width: 170px; }
.ag-team td { vertical-align: top; padding: 6px; height: 64px; }
.ag-team .is-today { background: #fffcf1; }
.ag-team thead a { color: inherit; text-decoration: none; text-transform: capitalize; }
.attendees { border: 0; padding: 0; margin: 0; }
.attendees legend { font-weight: 600; font-size: 13.5px; margin-bottom: 6px; }
.attendee-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 6px 14px; }
.push-right { margin-left: auto; }
.steps { margin: 0 0 12px; padding-left: 20px; display: grid; gap: 8px; }
.facts { display: grid; gap: 10px; margin: 12px 0 18px; }
.facts dt { font-size: 12.5px; color: var(--ink-3); }
.facts dd { margin: 0; }
.facts .pre { white-space: pre-line; }
form.inline { display: inline; margin-left: 8px; }
@media (max-width: 760px) {
  .ag-week.is-week .ag-row { grid-template-columns: 40px repeat(7, minmax(84px, 1fr)); }
  .ag-week.is-week { overflow-x: auto; }
  .ag-week { --ag-gut: 40px; }
  .ag-title { font-size: 16px; margin-left: 4px; }
}
/* positions générées : début (quarts d'heure), durée, colonnes */
.ag-s-0{top:calc(0 * var(--ag-q))}
.ag-s-1{top:calc(1 * var(--ag-q))}
.ag-s-2{top:calc(2 * var(--ag-q))}
.ag-s-3{top:calc(3 * var(--ag-q))}
.ag-s-4{top:calc(4 * var(--ag-q))}
.ag-s-5{top:calc(5 * var(--ag-q))}
.ag-s-6{top:calc(6 * var(--ag-q))}
.ag-s-7{top:calc(7 * var(--ag-q))}
.ag-s-8{top:calc(8 * var(--ag-q))}
.ag-s-9{top:calc(9 * var(--ag-q))}
.ag-s-10{top:calc(10 * var(--ag-q))}
.ag-s-11{top:calc(11 * var(--ag-q))}
.ag-s-12{top:calc(12 * var(--ag-q))}
.ag-s-13{top:calc(13 * var(--ag-q))}
.ag-s-14{top:calc(14 * var(--ag-q))}
.ag-s-15{top:calc(15 * var(--ag-q))}
.ag-s-16{top:calc(16 * var(--ag-q))}
.ag-s-17{top:calc(17 * var(--ag-q))}
.ag-s-18{top:calc(18 * var(--ag-q))}
.ag-s-19{top:calc(19 * var(--ag-q))}
.ag-s-20{top:calc(20 * var(--ag-q))}
.ag-s-21{top:calc(21 * var(--ag-q))}
.ag-s-22{top:calc(22 * var(--ag-q))}
.ag-s-23{top:calc(23 * var(--ag-q))}
.ag-s-24{top:calc(24 * var(--ag-q))}
.ag-s-25{top:calc(25 * var(--ag-q))}
.ag-s-26{top:calc(26 * var(--ag-q))}
.ag-s-27{top:calc(27 * var(--ag-q))}
.ag-s-28{top:calc(28 * var(--ag-q))}
.ag-s-29{top:calc(29 * var(--ag-q))}
.ag-s-30{top:calc(30 * var(--ag-q))}
.ag-s-31{top:calc(31 * var(--ag-q))}
.ag-s-32{top:calc(32 * var(--ag-q))}
.ag-s-33{top:calc(33 * var(--ag-q))}
.ag-s-34{top:calc(34 * var(--ag-q))}
.ag-s-35{top:calc(35 * var(--ag-q))}
.ag-s-36{top:calc(36 * var(--ag-q))}
.ag-s-37{top:calc(37 * var(--ag-q))}
.ag-s-38{top:calc(38 * var(--ag-q))}
.ag-s-39{top:calc(39 * var(--ag-q))}
.ag-s-40{top:calc(40 * var(--ag-q))}
.ag-s-41{top:calc(41 * var(--ag-q))}
.ag-s-42{top:calc(42 * var(--ag-q))}
.ag-s-43{top:calc(43 * var(--ag-q))}
.ag-s-44{top:calc(44 * var(--ag-q))}
.ag-s-45{top:calc(45 * var(--ag-q))}
.ag-s-46{top:calc(46 * var(--ag-q))}
.ag-s-47{top:calc(47 * var(--ag-q))}
.ag-s-48{top:calc(48 * var(--ag-q))}
.ag-s-49{top:calc(49 * var(--ag-q))}
.ag-s-50{top:calc(50 * var(--ag-q))}
.ag-s-51{top:calc(51 * var(--ag-q))}
.ag-s-52{top:calc(52 * var(--ag-q))}
.ag-s-53{top:calc(53 * var(--ag-q))}
.ag-s-54{top:calc(54 * var(--ag-q))}
.ag-s-55{top:calc(55 * var(--ag-q))}
.ag-s-56{top:calc(56 * var(--ag-q))}
.ag-s-57{top:calc(57 * var(--ag-q))}
.ag-s-58{top:calc(58 * var(--ag-q))}
.ag-s-59{top:calc(59 * var(--ag-q))}
.ag-s-60{top:calc(60 * var(--ag-q))}
.ag-s-61{top:calc(61 * var(--ag-q))}
.ag-s-62{top:calc(62 * var(--ag-q))}
.ag-s-63{top:calc(63 * var(--ag-q))}
.ag-s-64{top:calc(64 * var(--ag-q))}
.ag-s-65{top:calc(65 * var(--ag-q))}
.ag-s-66{top:calc(66 * var(--ag-q))}
.ag-s-67{top:calc(67 * var(--ag-q))}
.ag-s-68{top:calc(68 * var(--ag-q))}
.ag-s-69{top:calc(69 * var(--ag-q))}
.ag-s-70{top:calc(70 * var(--ag-q))}
.ag-s-71{top:calc(71 * var(--ag-q))}
.ag-s-72{top:calc(72 * var(--ag-q))}
.ag-s-73{top:calc(73 * var(--ag-q))}
.ag-s-74{top:calc(74 * var(--ag-q))}
.ag-s-75{top:calc(75 * var(--ag-q))}
.ag-s-76{top:calc(76 * var(--ag-q))}
.ag-s-77{top:calc(77 * var(--ag-q))}
.ag-s-78{top:calc(78 * var(--ag-q))}
.ag-s-79{top:calc(79 * var(--ag-q))}
.ag-s-80{top:calc(80 * var(--ag-q))}
.ag-s-81{top:calc(81 * var(--ag-q))}
.ag-s-82{top:calc(82 * var(--ag-q))}
.ag-s-83{top:calc(83 * var(--ag-q))}
.ag-s-84{top:calc(84 * var(--ag-q))}
.ag-s-85{top:calc(85 * var(--ag-q))}
.ag-s-86{top:calc(86 * var(--ag-q))}
.ag-s-87{top:calc(87 * var(--ag-q))}
.ag-s-88{top:calc(88 * var(--ag-q))}
.ag-s-89{top:calc(89 * var(--ag-q))}
.ag-s-90{top:calc(90 * var(--ag-q))}
.ag-s-91{top:calc(91 * var(--ag-q))}
.ag-s-92{top:calc(92 * var(--ag-q))}
.ag-s-93{top:calc(93 * var(--ag-q))}
.ag-s-94{top:calc(94 * var(--ag-q))}
.ag-s-95{top:calc(95 * var(--ag-q))}
.ag-d-1{height:calc(1 * var(--ag-q) - 2px)}
.ag-d-2{height:calc(2 * var(--ag-q) - 2px)}
.ag-d-3{height:calc(3 * var(--ag-q) - 2px)}
.ag-d-4{height:calc(4 * var(--ag-q) - 2px)}
.ag-d-5{height:calc(5 * var(--ag-q) - 2px)}
.ag-d-6{height:calc(6 * var(--ag-q) - 2px)}
.ag-d-7{height:calc(7 * var(--ag-q) - 2px)}
.ag-d-8{height:calc(8 * var(--ag-q) - 2px)}
.ag-d-9{height:calc(9 * var(--ag-q) - 2px)}
.ag-d-10{height:calc(10 * var(--ag-q) - 2px)}
.ag-d-11{height:calc(11 * var(--ag-q) - 2px)}
.ag-d-12{height:calc(12 * var(--ag-q) - 2px)}
.ag-d-13{height:calc(13 * var(--ag-q) - 2px)}
.ag-d-14{height:calc(14 * var(--ag-q) - 2px)}
.ag-d-15{height:calc(15 * var(--ag-q) - 2px)}
.ag-d-16{height:calc(16 * var(--ag-q) - 2px)}
.ag-d-17{height:calc(17 * var(--ag-q) - 2px)}
.ag-d-18{height:calc(18 * var(--ag-q) - 2px)}
.ag-d-19{height:calc(19 * var(--ag-q) - 2px)}
.ag-d-20{height:calc(20 * var(--ag-q) - 2px)}
.ag-d-21{height:calc(21 * var(--ag-q) - 2px)}
.ag-d-22{height:calc(22 * var(--ag-q) - 2px)}
.ag-d-23{height:calc(23 * var(--ag-q) - 2px)}
.ag-d-24{height:calc(24 * var(--ag-q) - 2px)}
.ag-d-25{height:calc(25 * var(--ag-q) - 2px)}
.ag-d-26{height:calc(26 * var(--ag-q) - 2px)}
.ag-d-27{height:calc(27 * var(--ag-q) - 2px)}
.ag-d-28{height:calc(28 * var(--ag-q) - 2px)}
.ag-d-29{height:calc(29 * var(--ag-q) - 2px)}
.ag-d-30{height:calc(30 * var(--ag-q) - 2px)}
.ag-d-31{height:calc(31 * var(--ag-q) - 2px)}
.ag-d-32{height:calc(32 * var(--ag-q) - 2px)}
.ag-d-33{height:calc(33 * var(--ag-q) - 2px)}
.ag-d-34{height:calc(34 * var(--ag-q) - 2px)}
.ag-d-35{height:calc(35 * var(--ag-q) - 2px)}
.ag-d-36{height:calc(36 * var(--ag-q) - 2px)}
.ag-d-37{height:calc(37 * var(--ag-q) - 2px)}
.ag-d-38{height:calc(38 * var(--ag-q) - 2px)}
.ag-d-39{height:calc(39 * var(--ag-q) - 2px)}
.ag-d-40{height:calc(40 * var(--ag-q) - 2px)}
.ag-d-41{height:calc(41 * var(--ag-q) - 2px)}
.ag-d-42{height:calc(42 * var(--ag-q) - 2px)}
.ag-d-43{height:calc(43 * var(--ag-q) - 2px)}
.ag-d-44{height:calc(44 * var(--ag-q) - 2px)}
.ag-d-45{height:calc(45 * var(--ag-q) - 2px)}
.ag-d-46{height:calc(46 * var(--ag-q) - 2px)}
.ag-d-47{height:calc(47 * var(--ag-q) - 2px)}
.ag-d-48{height:calc(48 * var(--ag-q) - 2px)}
.ag-d-49{height:calc(49 * var(--ag-q) - 2px)}
.ag-d-50{height:calc(50 * var(--ag-q) - 2px)}
.ag-d-51{height:calc(51 * var(--ag-q) - 2px)}
.ag-d-52{height:calc(52 * var(--ag-q) - 2px)}
.ag-d-53{height:calc(53 * var(--ag-q) - 2px)}
.ag-d-54{height:calc(54 * var(--ag-q) - 2px)}
.ag-d-55{height:calc(55 * var(--ag-q) - 2px)}
.ag-d-56{height:calc(56 * var(--ag-q) - 2px)}
.ag-d-57{height:calc(57 * var(--ag-q) - 2px)}
.ag-d-58{height:calc(58 * var(--ag-q) - 2px)}
.ag-d-59{height:calc(59 * var(--ag-q) - 2px)}
.ag-d-60{height:calc(60 * var(--ag-q) - 2px)}
.ag-d-61{height:calc(61 * var(--ag-q) - 2px)}
.ag-d-62{height:calc(62 * var(--ag-q) - 2px)}
.ag-d-63{height:calc(63 * var(--ag-q) - 2px)}
.ag-d-64{height:calc(64 * var(--ag-q) - 2px)}
.ag-d-65{height:calc(65 * var(--ag-q) - 2px)}
.ag-d-66{height:calc(66 * var(--ag-q) - 2px)}
.ag-d-67{height:calc(67 * var(--ag-q) - 2px)}
.ag-d-68{height:calc(68 * var(--ag-q) - 2px)}
.ag-d-69{height:calc(69 * var(--ag-q) - 2px)}
.ag-d-70{height:calc(70 * var(--ag-q) - 2px)}
.ag-d-71{height:calc(71 * var(--ag-q) - 2px)}
.ag-d-72{height:calc(72 * var(--ag-q) - 2px)}
.ag-d-73{height:calc(73 * var(--ag-q) - 2px)}
.ag-d-74{height:calc(74 * var(--ag-q) - 2px)}
.ag-d-75{height:calc(75 * var(--ag-q) - 2px)}
.ag-d-76{height:calc(76 * var(--ag-q) - 2px)}
.ag-d-77{height:calc(77 * var(--ag-q) - 2px)}
.ag-d-78{height:calc(78 * var(--ag-q) - 2px)}
.ag-d-79{height:calc(79 * var(--ag-q) - 2px)}
.ag-d-80{height:calc(80 * var(--ag-q) - 2px)}
.ag-d-81{height:calc(81 * var(--ag-q) - 2px)}
.ag-d-82{height:calc(82 * var(--ag-q) - 2px)}
.ag-d-83{height:calc(83 * var(--ag-q) - 2px)}
.ag-d-84{height:calc(84 * var(--ag-q) - 2px)}
.ag-d-85{height:calc(85 * var(--ag-q) - 2px)}
.ag-d-86{height:calc(86 * var(--ag-q) - 2px)}
.ag-d-87{height:calc(87 * var(--ag-q) - 2px)}
.ag-d-88{height:calc(88 * var(--ag-q) - 2px)}
.ag-d-89{height:calc(89 * var(--ag-q) - 2px)}
.ag-d-90{height:calc(90 * var(--ag-q) - 2px)}
.ag-d-91{height:calc(91 * var(--ag-q) - 2px)}
.ag-d-92{height:calc(92 * var(--ag-q) - 2px)}
.ag-d-93{height:calc(93 * var(--ag-q) - 2px)}
.ag-d-94{height:calc(94 * var(--ag-q) - 2px)}
.ag-d-95{height:calc(95 * var(--ag-q) - 2px)}
.ag-d-96{height:calc(96 * var(--ag-q) - 2px)}
.ag-n-1.ag-l-0{left:calc(0 * 100% / 1 + 2px);width:calc(100% / 1 - 4px)}
.ag-n-2.ag-l-0{left:calc(0 * 100% / 2 + 2px);width:calc(100% / 2 - 4px)}
.ag-n-2.ag-l-1{left:calc(1 * 100% / 2 + 2px);width:calc(100% / 2 - 4px)}
.ag-n-3.ag-l-0{left:calc(0 * 100% / 3 + 2px);width:calc(100% / 3 - 4px)}
.ag-n-3.ag-l-1{left:calc(1 * 100% / 3 + 2px);width:calc(100% / 3 - 4px)}
.ag-n-3.ag-l-2{left:calc(2 * 100% / 3 + 2px);width:calc(100% / 3 - 4px)}
.ag-n-4.ag-l-0{left:calc(0 * 100% / 4 + 2px);width:calc(100% / 4 - 4px)}
.ag-n-4.ag-l-1{left:calc(1 * 100% / 4 + 2px);width:calc(100% / 4 - 4px)}
.ag-n-4.ag-l-2{left:calc(2 * 100% / 4 + 2px);width:calc(100% / 4 - 4px)}
.ag-n-4.ag-l-3{left:calc(3 * 100% / 4 + 2px);width:calc(100% / 4 - 4px)}
.ag-now{width:auto}
.vat-table textarea { field-sizing: content; min-height: 60px; }
@media (max-width: 760px) { .ag-allday .ag-gutter span { font-size: 9px; } }
/* Connexion : code par e-mail */
.auth-alt { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.link-btn { padding: 0; border: 0; background: none; color: var(--action, #2c64a8); font: inherit; font-size: 14px; text-align: left;
  text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.link-btn:hover { color: var(--ink); }
.auth-alt p { margin: 6px 0 0; }
.sup-line + .sup-line { margin-top: 4px; }
.sup-line .badge { font-size: 11px; padding: 1px 6px; margin-right: 4px; }

/* Glisser-déposer sur les champs fichier */
.filedrop { position: relative; border-radius: var(--r); transition: background-color .12s, box-shadow .12s; }
body.is-dragging-files .filedrop { box-shadow: 0 0 0 2px rgba(44, 100, 168, .35); background-color: rgba(44, 100, 168, .04); }
.filedrop.is-over, body.is-dragging-files .filedrop.is-over { box-shadow: 0 0 0 2px var(--action); background-color: var(--action-soft); }
body.is-dragging-files .filedrop::after { content: "Déposez ici"; position: absolute; top: 6px; right: 8px; padding: 2px 8px; border-radius: 999px;
  background: var(--action); color: #fff; font-size: 12px; font-weight: 600; pointer-events: none; z-index: 2; }
.filedrop-hint { display: block; margin-top: 4px; color: var(--ink-3); font-size: 12.5px; }
.filedrop-note { display: block; margin-top: 6px; font-size: 12.5px; color: var(--ok); }
.filedrop-note.is-bad { color: var(--danger, #b5372b); }
.emp-head-photo.filedrop, .tiers-logo.filedrop { padding: 4px; margin: -4px; }

/* En-tête : actions + flèches précédent / suivant */
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; margin-left: auto; padding-bottom: 14px; }
.head-side:empty { display: none; }
.head-side > .head-actions { margin-left: 0; padding-bottom: 0; }
.rec-nav { display: flex; align-items: center; gap: 6px; }
.rec-arrow { width: 34px; height: 30px; padding: 0; justify-content: center; }
.rec-arrow.is-disabled { opacity: .35; pointer-events: none; }
.rec-pos { min-width: 64px; text-align: center; font-size: 13px; color: var(--ink-3); }
@media (max-width: 760px) { .head-side { margin-left: 0; width: 100%; align-items: flex-start; } }

/* Paramètres → listes : titres de groupe bien visibles */
.split-group { font-weight: 700; font-style: italic; text-decoration: underline; text-underline-offset: 3px;
  text-decoration-thickness: 1.5px; color: var(--ink); font-size: 13.5px; }

/* Ligne du temps des étapes (offres, projets, factures) */
.timeline { position: relative; margin: 0 0 16px; padding: 14px 18px 12px; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); }
.timeline ol { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: 0; padding: 0; list-style: none; }
.tl-step { position: relative; }
.tl-step::before { content: ""; position: absolute; top: 15px; left: calc(-50% + 18px); right: calc(50% + 18px); height: 3px; background: var(--rule); border-radius: 2px; }
.tl-step:first-child::before { display: none; }
.tl-step.is-done::before, .tl-step.is-current::before { background: var(--ok); }
.tl-hit { display: flex; flex-direction: column; align-items: center; gap: 5px; width: 100%; padding: 0 4px 2px; border: 0; background: none;
  font: inherit; color: inherit; text-align: center; border-radius: var(--r-sm); }
button.tl-hit { cursor: pointer; }
button.tl-hit:hover .tl-dot { box-shadow: 0 0 0 4px var(--action-soft); border-color: var(--action); }
button.tl-hit:hover .tl-label { color: var(--action); }
button.tl-hit:focus-visible { outline: 2px solid var(--action); outline-offset: 2px; }
.tl-dot { position: relative; z-index: 1; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid var(--rule); background: #fff; color: var(--ink-3); font-weight: 700; font-size: 13px; font-variant-numeric: tabular-nums;
  transition: box-shadow .12s, border-color .12s; }
.tl-step.is-done .tl-dot { background: var(--ok); border-color: var(--ok); color: #fff; }
.tl-step.is-current .tl-dot { background: #fff; border-color: var(--ok); color: var(--ok); box-shadow: 0 0 0 4px var(--ok-soft); }
.tl-label { font-size: 13.5px; font-weight: 600; color: var(--ink-2); line-height: 1.25; }
.tl-step.is-current .tl-label { color: var(--ink); }
.tl-step.is-todo .tl-label { font-weight: 500; color: var(--ink-3); }
.tl-hint { font-size: 11.5px; color: var(--ink-3); line-height: 1.25; }
.timeline.is-exited ol { opacity: .45; }
.tl-exit { position: absolute; top: 10px; right: 12px; margin: 0; }
.tl-aside { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; margin: -8px 0 16px; }
@media (max-width: 760px) {
  .timeline { overflow-x: auto; }
  .timeline ol { min-width: 560px; }
  .tl-hint { display: none; }
}

.badge-late { background: #fbe3df; color: #9b2c22; }

/* --- Facturation ------------------------------------------------------------- */
.facts-grid { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin: 0 0 14px; }
.pay-sum { display: grid; gap: 0; margin: 0 0 14px; }
.pay-sum > div { display: flex; justify-content: space-between; gap: 16px; padding: 6px 2px; border-bottom: 1px solid var(--rule-2); }
.pay-sum dt { color: var(--ink-2); }
.pay-sum dd { margin: 0; font-variant-numeric: tabular-nums; }
.pay-sum .is-strong dt, .pay-sum .is-strong dd { font-weight: 600; color: var(--ink); }
.pay-sum .is-total { margin-top: 4px; padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: #222c33; color: #fff; }
.pay-sum .is-total dt { color: #fff; font-weight: 600; }
.pay-sum .is-total dd { font-size: 17px; font-weight: 700; }
.pay-sum .is-total.is-late { background: #9b2c22; }
.pay-form { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rule-2); }
.table.compact td, .table.compact th { padding: 6px 8px; }
.inv-lines tr.is-deduction td { background: #fafaf8; }
.inv-lines tr.is-deduction [data-line-total] { color: var(--ink-2); }
.bill-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 8px 0 16px; padding: 12px 14px;
  background: #f6f7f5; border: 1px solid var(--rule-2); border-radius: var(--r); }
.bill-strip dt { font-size: 12.5px; color: var(--ink-3); }
.bill-strip dd { margin: 2px 0 0; font-size: 17px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bill-types { margin-bottom: 16px; flex-wrap: wrap; }
.bill-progress { display: block; width: 100%; height: 8px; margin: 6px 0 14px; border: 0; border-radius: 999px; background: var(--rule-2); overflow: hidden; appearance: none; }
.bill-progress::-webkit-progress-bar { background: var(--rule-2); border-radius: 999px; }
.bill-progress::-webkit-progress-value { background: var(--ok); border-radius: 999px; }
.bill-progress::-moz-progress-bar { background: var(--ok); border-radius: 999px; }
.bill-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
@media (max-width: 760px) { .bill-strip { grid-template-columns: 1fr; } }

/* Les menus de l'en-tête (Envoyer…) passent au-dessus de la ligne du temps et du contenu */
.app-head { z-index: 12; }
.app-head .drop-panel { z-index: 15; }

.rewind-box { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }

/* Filtre / tri de colonne façon Excel */
th[data-colfilter] { white-space: nowrap; }
.colf-btn {
  display: inline-grid; place-items: center; width: 20px; height: 20px; margin-left: 4px; padding: 0;
  vertical-align: middle; border: 1px solid transparent; border-radius: 4px; background: transparent; color: var(--ink-3); cursor: pointer;
}
.colf-btn:hover, .colf-btn:focus-visible { border-color: var(--rule); background: var(--panel); color: var(--ink); }
th.is-filtered .colf-btn { background: var(--action, #1d5fa8); border-color: var(--action, #1d5fa8); color: #fff; }
th.is-sorted-asc .colf-btn svg { transform: rotate(180deg); }
th.is-sorted-asc .colf-btn, th.is-sorted-desc .colf-btn { border-color: var(--rule); color: var(--ink); }
.colf-panel {
  position: absolute; z-index: 40; width: 280px; padding: 6px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .18); font-size: 13px; text-align: left; font-weight: 400;
}
.colf-sort { display: block; width: 100%; padding: 7px 8px; border: 0; border-radius: 4px; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.colf-sort:hover, .colf-sort:focus-visible { background: var(--action-soft, #eef3fa); }
.colf-panel hr { margin: 6px 0; border: 0; border-top: 1px solid var(--rule); }
.colf-search { width: 100%; margin: 2px 0 6px; padding: 6px 8px; font: inherit; }
.colf-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--rule); border-radius: 4px; padding: 2px 0; }
.colf-item { display: flex; gap: 8px; align-items: center; padding: 4px 8px; cursor: pointer; }
.colf-item[hidden] { display: none; }
.colf-item:hover { background: var(--action-soft, #eef3fa); }
.colf-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.colf-item small { color: var(--ink-3); }
.colf-all { font-weight: 600; }
.colf-table tr.is-col-out, .colf-table tr.is-search-out { display: none; }
.colf-foot { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; }
@media print { .colf-btn { display: none; } }

/* Listes déroulantes : même flèche pour les listes simples et celles où l'on tape pour chercher */
select:not([multiple]) {
  -webkit-appearance: none; appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%234f5d66' stroke-width='1.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center; background-size: 11px 7px;
}
.level-select:not([multiple]), .item-kind select { padding-right: 24px; background-position: right 7px center; }

/* Liste déroulante avec recherche */
.combo { position: relative; }
.combo-source { display: none; }
.combo-input { width: 100%; padding-right: 30px; background-image: none; }
.combo::after {
  content: ""; position: absolute; right: 12px; top: 50%; width: 7px; height: 7px; margin-top: -6px; pointer-events: none;
  border-right: 1.6px solid var(--ink-2); border-bottom: 1.6px solid var(--ink-2); transform: rotate(45deg);
}
.combo-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: calc(100% + 2px); max-height: 280px; overflow-y: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .16);
}
.combo-list li { padding: 7px 12px; cursor: pointer; }
.combo-list li.is-active, .combo-list li:hover { background: var(--action-soft); }
.combo-list li[aria-selected="true"] { font-weight: 600; }
.combo-list .combo-none { color: var(--ink-3); font-style: italic; }
.combo-list .combo-empty { color: var(--ink-3); cursor: default; }

/* Documents de projet : lignes éditables */
.doc-lines input { width: 100%; min-width: 90px; }
.doc-lines input.w-xs { width: 80px; min-width: 64px; }
.doc-lines input.w-s { width: 120px; }
.doc-lines td { vertical-align: middle; }
.panel-tight { margin-bottom: 12px; }
.doc-kinds { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }

/* Poignée de glisser-déposer (lignes d'offre, de facture, de bon ; éléments de liste) */
.drag-handle {
  display: inline-grid; place-items: center; width: 26px; height: 32px; padding: 0; border: 1px solid transparent;
  border-radius: 4px; background: transparent; cursor: grab; touch-action: none;
}
.drag-handle:hover, .drag-handle:focus-visible { border-color: var(--rule); background: var(--rule-2); }
.drag-handle:hover .grip, .drag-handle:focus-visible .grip { opacity: .9; }
.drag-handle:active { cursor: grabbing; }
tr.is-dragging { opacity: .45; }
tr.drop-before > td { box-shadow: inset 0 3px 0 var(--action); }
tr.drop-after > td { box-shadow: inset 0 -3px 0 var(--action); }
.offer-lines .cell-move, .doc-lines .cell-move { width: 34px; }
body.is-saving { cursor: progress; }

/* Aide */
.c-aide { --wire: #3f7f9e; }
.help-search-label { display: block; font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.help-search-row { display: flex; gap: 8px; }
.help-search-row input { flex: 1; font-size: 16px; padding: 10px 12px; }
.help-chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.help-card h2 { font-size: 16.5px; margin: 0 0 4px; }
.help-card h2 a { color: var(--ink); text-decoration: none; display: flex; gap: 10px; align-items: baseline; }
.help-card h2 a:hover { text-decoration: underline; }
.help-num { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 12px; background: var(--wire, #3f7f9e); color: #fff; font-size: 12.5px; font-weight: 700; }
.help-card ul { margin: 8px 0 4px; padding-left: 18px; }
.help-card li { margin: 3px 0; }
.help-results { list-style: none; margin: 0; padding: 0; }
.help-results li { padding: 12px 0; border-bottom: 1px solid var(--rule-2); }
.help-results li:last-child { border-bottom: 0; }
.help-result-title { font-weight: 600; font-size: 15.5px; }
.help-result-chapter { margin-left: 8px; font-size: 12.5px; color: var(--ink-3); }
.help-results p { margin: 4px 0 0; color: var(--ink-2); max-width: 90ch; }
mark { background: #fff1a8; color: inherit; padding: 0 1px; border-radius: 2px; }
.help-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 16px; align-items: start; }
.help-toc { position: sticky; top: 76px; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 13.5px; }
.help-toc ul, .help-toc ol { margin: 0 0 12px; padding-left: 18px; }
.help-toc li { margin: 4px 0; }
.help-toc li.is-current > a { font-weight: 700; color: var(--ink); }
.help-toc-title { margin: 10px 0 4px; font-weight: 700; color: var(--ink-2); }
.help-toc-search input { width: 100%; }
.help-body { max-width: 900px; line-height: 1.6; font-size: 15px; }
.help-body h2 { margin: 30px 0 8px; padding-top: 6px; border-top: 1px solid var(--rule-2); font-size: 19px; scroll-margin-top: 80px; }
.help-body h2:first-of-type { border-top: 0; margin-top: 8px; }
.help-body h3 { margin: 20px 0 6px; font-size: 16px; scroll-margin-top: 80px; }
.help-body p, .help-body li { max-width: 80ch; }
.help-body li { margin: 4px 0; }
.help-body code { background: var(--rule-2); padding: 1px 5px; border-radius: 3px; font-size: 13.5px; }
.help-body pre { background: #1f262c; color: #e8edf1; padding: 12px 14px; border-radius: 6px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
.help-body pre code { background: none; padding: 0; color: inherit; }
.help-lead { font-size: 16.5px; color: var(--ink-2); margin-top: 0; }
.help-note { border-left: 4px solid var(--wire, #3f7f9e); background: var(--rule-2); padding: 10px 14px; margin: 12px 0; border-radius: 0 6px 6px 0; max-width: 80ch; }
.help-table td, .help-table th { vertical-align: top; }
.help-pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--rule-2); }
@media (max-width: 900px) {
  .help-layout { grid-template-columns: 1fr; }
  .help-toc { position: static; max-height: none; }
  .help-search-row { flex-direction: column; }
}
@media print { .help-toc, .help-pager { display: none; } .help-layout { display: block; } }

/* Suggestions d'adresses e-mail */
.mail-suggest-wrap { position: relative; }
.mail-suggest {
  position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 2px); max-height: 300px; overflow-y: auto; margin: 0; padding: 4px 0;
  list-style: none; background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .16); text-align: left;
}
.mail-suggest li { padding: 6px 12px; cursor: pointer; display: grid; gap: 1px; }
.mail-suggest li.is-active, .mail-suggest li:hover { background: var(--action-soft); }
.ms-name { font-weight: 600; display: flex; gap: 8px; align-items: baseline; }
.ms-kind { font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.ms-mail { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.send-to { display: grid; gap: 4px; padding: 10px 12px 8px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.send-to input { width: 100%; font-weight: 400; }
.send-panel { min-width: 360px; }
.app-head .send-panel form, .head-actions .send-panel form { display: block; }
.head-actions .send-panel .send-to { display: grid; text-align: left; }
.send-panel { min-width: 400px; }

/* Texte mis en forme (clic droit sur une sélection) */
.rich-editor {
  width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--field, #fff);
  color: var(--ink); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text; outline: none;
}
.rich-editor:focus { border-color: var(--action); box-shadow: 0 0 0 3px var(--action-soft); }
.rich-editor[contenteditable="false"] { background: var(--rule-2); cursor: default; }
.rich-editor:empty::before { content: attr(data-placeholder); color: var(--ink-3); }
.rich-editor ul, .rich-editor ol { margin: 2px 0; padding-left: 24px; }
mark[data-c="jaune"] { background: #fff1a8; }
mark[data-c="vert"] { background: #c8f2c2; }
mark[data-c="bleu"] { background: #cfe3ff; }
mark[data-c="rose"] { background: #ffd3e6; }
.rich-editor mark { color: inherit; padding: 0; }
.rich-menu {
  position: fixed; z-index: 80; width: 252px; padding: 8px; background: var(--panel); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 10px 30px rgba(20, 30, 36, .22); font-size: 13px;
}
.rm-row { display: flex; flex-wrap: wrap; gap: 4px; }
.rm-row button, .rm-item {
  min-width: 34px; height: 30px; padding: 0 8px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel);
  color: inherit; font: inherit; cursor: pointer;
}
.rm-row button:hover, .rm-item:hover, .rm-row button:focus-visible, .rm-item:focus-visible { background: var(--action-soft); border-color: var(--action); }
.rm-label { margin: 8px 0 4px; font-size: 11.5px; font-weight: 600; color: var(--ink-3); }
.rm-swatch { min-width: 30px !important; padding: 0 !important; display: inline-grid; place-items: center; }
.rm-swatch span { width: 16px; height: 16px; border-radius: 50%; display: block; }
.rm-swatch mark { padding: 1px 3px; border-radius: 2px; }
.rm-swatch [data-sw="noir"] { background: #1f262c; }
.rm-swatch [data-sw="gris"] { background: #6b7780; }
.rm-swatch [data-sw="rouge"] { background: #c62828; }
.rm-swatch [data-sw="orange"] { background: #e67e22; }
.rm-swatch [data-sw="vert"] { background: #2e7d32; }
.rm-swatch [data-sw="bleu"] { background: #1d5fa8; }
.rm-swatch [data-sw="violet"] { background: #7b3fa0; }
.rm-sep { height: 1px; margin: 8px 0 6px; background: var(--rule-2); }
.rm-item { display: block; width: 100%; text-align: left; margin-top: 4px; }
.rich-editor hr { position: relative; margin: 18px 0; border: 0; border-top: 2px dashed var(--action); overflow: visible; }
.rich-editor hr::after {
  content: "Saut de page"; position: absolute; left: 50%; top: -10px; transform: translateX(-50%); padding: 0 8px;
  background: var(--field, #fff); color: var(--action); font-size: 11.5px; font-weight: 600;
}
.rich-break, .rich-img, .rich-table { width: 290px; }
.rich-menu > .rm-item:first-child { margin-top: 0; }
.rm-danger { color: var(--danger, #b42318); }
.rm-panel p { margin: 2px 2px 8px; line-height: 1.4; }
.rm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.rm-grid label { display: grid; gap: 3px; font-size: 12px; color: var(--ink-3); font-weight: 600; }
.rm-grid input { width: 100%; height: 30px; padding: 0 6px; border: 1px solid var(--rule); border-radius: 4px; font: inherit; }
.rm-check { display: flex; align-items: center; gap: 6px; margin: 0 0 10px; }
.rm-choices { max-height: 240px; overflow: auto; margin-bottom: 8px; }
.rm-choices small { color: var(--ink-3); margin-left: 4px; }
.rm-range { align-items: center; flex-wrap: nowrap; }
.rm-range input { flex: 1; min-width: 0; accent-color: var(--action); }
.rm-range output { flex: none; min-width: 112px; text-align: right; font-variant-numeric: tabular-nums; color: var(--ink-2, var(--ink)); }
.rm-row button.on { background: var(--action-soft); border-color: var(--action); font-weight: 600; }
.rich-status { margin-top: 4px; font-size: 12.5px; color: var(--ink-3); }
.rich-status.error { color: var(--danger, #b42318); font-weight: 600; }
.rich-status.note { color: var(--action); }
/* tableaux et images dans un texte */
.rich-editor table { width: 100%; margin: 6px 0; border-collapse: collapse; white-space: normal; }
.rich-editor td, .rich-editor th {
  height: 1.9em; padding: 3px 6px; border: 1px solid var(--rule); vertical-align: top; text-align: left; min-width: 3em;
}
.rich-editor th { background: var(--rule-2); font-weight: 600; }
.rich-editor img { display: block; width: 100%; height: auto; margin: 6px auto; border-radius: 2px; cursor: context-menu; }
.rich-editor img[data-align="g"] { margin-left: 0; }
.rich-editor img[data-align="d"] { margin-right: 0; }
.rich-editor img:hover { outline: 2px solid var(--action-soft); }
.rm-confirm p { margin: 2px 2px 8px; line-height: 1.4; }
.rm-ok { background: var(--action) !important; border-color: var(--action) !important; color: #fff; font-weight: 600; }

/* Application de pointage : QR codes (Prestations → Téléphones) */
.gsm-qr { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 14px; }
.gsm-qr .qr { flex: none; width: 168px; }
.gsm-qr .qr-big { width: 240px; }
.gsm-qr p { margin: 0 0 8px; }
.gsm-steps { margin: 0; padding-left: 20px; line-height: 1.5; }
.gsm-steps li + li { margin-top: 6px; }
.gsm-link .nowrap { overflow-wrap: anywhere; white-space: normal; }
.gsm-link h2 + .gsm-qr { margin-top: 4px; }
.gsm-link .flash { margin: 0 0 14px; }
@media (max-width: 640px) { .gsm-qr { flex-direction: column; } }

/* Encoder des heures (Prestations) */
.encode-pick { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; }
.encode-pick .field { min-width: 220px; }
.encode-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.encode-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 24px; margin-bottom: 10px; }
.encode-head h2 { margin: 0; }
.encode-totals { display: flex; gap: 20px; margin: 0; color: var(--ink-2); }
.encode-totals strong { color: var(--ink); font-size: 1.05em; }
.encode-validate { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.encode-validate input { flex: 1 1 260px; min-width: 0; }
.encode-lines select, .encode-lines input { width: 100%; min-width: 0; }
.encode-lines td:nth-child(1) { min-width: 130px; }
.encode-lines td:nth-child(2), .encode-lines td:nth-child(3) { min-width: 190px; }
.encode-lines td:nth-child(4), .encode-lines td:nth-child(5) { width: 110px; }
.encode-lines td:nth-child(6) { min-width: 180px; }
.encode-reason { margin-top: 14px; }
.col-check { width: 34px; text-align: center; }
/* Paramètres : types de pointage */
.item-kind { display: flex; align-items: center; gap: 12px; margin: 0; }
.item-kind select { height: 30px; padding: 0 6px; font-size: 13px; }
.item-kind .check { display: flex; align-items: center; gap: 5px; font-size: 13px; color: var(--ink-2, var(--ink)); white-space: nowrap; }
@media (max-width: 760px) { .item-kind { margin-left: 22px; flex-wrap: wrap; } }

/* Calendrier des prestations */
.cal-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cal-pick { margin: 0; }
.cal-title { order: 9; flex: 1 0 100%; margin: 4px 0 0; font: 600 22px/1.2 var(--font-din); }
.cal-title::first-letter { text-transform: uppercase; }
.cal-nav { display: flex; gap: 6px; }
.seg { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.seg a { padding: 7px 14px; color: var(--ink); text-decoration: none; font-weight: 600; font-size: 14px; }
.seg a + a { border-left: 1px solid var(--rule); }
.seg a[aria-current] { background: var(--ink); color: #fff; }
.people-pick { position: relative; }
.people-pick > summary { list-style: none; cursor: pointer; }
.people-pick > summary::-webkit-details-marker { display: none; }
.people-pick > summary::after { content: " ▾"; }
.people-panel {
  position: absolute; z-index: 30; top: calc(100% + 6px); left: 0; width: 300px; padding: 12px; display: grid; gap: 10px;
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--r); box-shadow: 0 10px 28px rgba(20, 30, 36, .16);
}
.people-panel input[type=search] { height: 34px; padding: 0 10px; border: 1px solid var(--rule); border-radius: var(--r-sm); font: inherit; }
.people-quick { display: flex; gap: 6px; }
.people-list { max-height: 300px; overflow: auto; margin: 0; padding: 0; list-style: none; }
.people-list label { display: flex; align-items: center; gap: 8px; padding: 5px 4px; cursor: pointer; }
.people-list li.is-off label { color: var(--ink-3, #7a868d); }
.dot { display: inline-block; flex: none; width: 10px; height: 10px; margin-right: 6px; border-radius: 50%; background: var(--who, var(--ink)); vertical-align: middle; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 12px; padding: 0; list-style: none; font-size: 13px; color: var(--ink-2, var(--ink)); }
.cal-legend li { display: flex; align-items: center; }
.cal-legend .sep { width: 1px; align-self: stretch; background: var(--rule); }
.swatch { display: inline-block; width: 16px; height: 10px; margin-right: 6px; border-radius: 2px; border: 1px solid rgba(0,0,0,.12); }
.cat-travail { --fill: #e7e9e5; --edge: #6f7d86; }
.cat-trajet { --fill: #d4e4f8; --edge: #2c64a8; }
.cat-pause { --fill: repeating-linear-gradient(135deg, #eef3e4 0 6px, #f8f2d2 6px 12px); --edge: #8a9a3c; }
.swatch.cat-travail, .swatch.cat-trajet, .swatch.cat-pause { background: var(--fill); }
.swatch.is-check { background: var(--warn-soft); border: 1px dashed var(--warn); }

.cal-scroll { overflow-x: auto; }
.cal-grid {
  display: grid; grid-template-columns: 56px repeat(var(--cols, 1), minmax(130px, 1fr));
  grid-template-rows: auto 1fr; min-width: min(100%, calc(56px + var(--cols, 1) * 130px));
}
.cal-corner { border-bottom: 1px solid var(--rule); }
.cal-head { padding: 6px 8px 8px; border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); font-weight: 600; font-size: 14px; }
.cal-head a { color: var(--ink); text-decoration: none; }
.cal-head a:hover { text-decoration: underline; }
.cal-head small { display: block; font-weight: 500; color: var(--ink-3, #7a868d); font-variant-numeric: tabular-nums; }
.cal-head.is-today { box-shadow: inset 0 3px 0 var(--action); }
.cal-hours { display: grid; grid-template-rows: repeat(var(--rows, 14), 46px); }
.cal-hours span { padding-right: 8px; text-align: right; font-size: 11.5px; color: var(--ink-3, #7a868d); transform: translateY(-7px); font-variant-numeric: tabular-nums; }
.cal-col { position: relative; display: grid; grid-template-rows: repeat(var(--rows, 14), 46px); border-left: 1px solid var(--rule); }
.cal-col.is-today { background: #f7f9fc; }
.cal-line { border-top: 1px solid #eceeea; }
.cal-block {
  position: absolute; box-sizing: border-box; overflow: hidden; margin: 0 2px; padding: 3px 6px 3px 7px;
  min-height: 14px; border-radius: 3px; border-left: 4px solid var(--who, var(--edge)); background: var(--fill);
  box-shadow: inset 0 0 0 1px rgba(30, 41, 48, .08); color: var(--ink); font-size: 12px; line-height: 1.25; text-decoration: none;
}
.cal-block:hover { box-shadow: inset 0 0 0 1px var(--edge), 0 2px 6px rgba(20, 30, 36, .15); z-index: 2; }
.cal-block span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-time { font-weight: 600; font-variant-numeric: tabular-nums; }
.cal-task { color: var(--ink-2, var(--ink)); }
.cal-block.is-small { padding-top: 0; padding-bottom: 0; font-size: 11px; }
.cal-block.is-small .cal-what, .cal-block.is-small .cal-task { display: none; }
.cal-block.is-check { outline: 1.5px dashed var(--warn); outline-offset: -1.5px; }
.cal-block.is-refused { opacity: .5; text-decoration: line-through; }
.cal-block.is-open { border-bottom: 3px solid var(--ok); }

.cal-rows { width: 100%; border-collapse: collapse; font-size: 13px; }
.cal-rows th, .cal-rows td { padding: 7px 8px; border-bottom: 1px solid var(--rule); text-align: left; vertical-align: middle; }
.cal-rows thead th { font-size: 12.5px; color: var(--ink-2, var(--ink)); }
.cal-rows thead a { color: inherit; text-decoration: none; }
.cal-rows tbody th { white-space: nowrap; font-weight: 600; }
.cal-rows td { min-width: 96px; }
.cal-strip { position: relative; height: 12px; margin-bottom: 3px; border-radius: 2px; background: #f0f1ee; }
.cal-bar-seg { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--edge); }
.cal-bar-seg.cat-pause { background: var(--fill); }
.cal-bar-seg.is-check { box-shadow: 0 0 0 1.5px var(--warn); }
.cal-bar-seg.is-refused { opacity: .3; }
.cal-total { font-variant-numeric: tabular-nums; }

.cal-month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--rule); border-left: 1px solid var(--rule); }
.cal-mhead { padding: 6px 8px; border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); font-size: 12.5px; font-weight: 600; color: var(--ink-2, var(--ink)); }
.cal-day {
  display: flex; flex-direction: column; gap: 2px; min-height: 104px; padding: 6px 8px; border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule); color: var(--ink); text-decoration: none; font-size: 12.5px;
}
.cal-day:hover { background: #f6f8fb; }
.cal-day.is-out { background: #f6f6f3; color: var(--ink-3, #7a868d); }
.cal-day.is-today .cal-dnum { background: var(--action); color: #fff; }
.cal-dnum { align-self: flex-start; min-width: 24px; padding: 1px 6px; border-radius: 12px; font-weight: 700; font-variant-numeric: tabular-nums; text-align: center; }
.cal-dline { display: flex; align-items: center; gap: 4px; white-space: nowrap; overflow: hidden; }
.cal-dline .dot { margin-right: 0; }
.cal-dline .warn, .cal-more { color: var(--warn); }
.cal-more { font-size: 12px; }
@media (max-width: 760px) {
  .cal-day { min-height: 74px; padding: 4px; }
  .cal-dline { font-size: 11px; }
  .people-panel { width: min(300px, calc(100vw - 48px)); }
}
/* Tableaux dans un texte : sélection de lignes / colonnes / cases, poignées, barre d'actions */
.rich-editor td.is-sel, .rich-editor th.is-sel { background: #d9e6f6; box-shadow: inset 0 0 0 1px var(--action); }
.rich-grips { position: fixed; inset: 0 auto auto 0; z-index: 40; width: 0; height: 0; }
.rg {
  position: fixed; box-sizing: border-box; padding: 0; border: 1px solid var(--rule); border-radius: 3px; background: #f1f2ef;
  cursor: pointer; transition: background .12s;
}
.rg-col { height: 10px; margin-left: 1px; }
.rg-row { width: 10px; margin-top: 1px; }
.rg:hover { background: var(--action-soft); border-color: var(--action); }
.rg.on { background: var(--action); border-color: var(--action); }
.rg:focus-visible { outline: none; box-shadow: var(--focus); }
.rich-menu.rich-tbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px; width: auto; max-width: min(620px, calc(100vw - 16px));
  padding: 5px 6px;
}
.rich-tbar[hidden] { display: none; }
.rich-tbar .tb-what { padding: 0 8px 0 4px; font-size: 12.5px; font-weight: 700; color: var(--ink-2); white-space: nowrap; }
.rich-tbar button {
  height: 30px; padding: 0 10px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; color: var(--ink);
  font: 600 13px var(--font-body); white-space: nowrap; cursor: pointer;
}
.rich-tbar button:hover { background: var(--action-soft); border-color: var(--action); }
.rich-tbar .tb-danger { color: var(--danger); }
.rich-tbar .tb-danger:hover { background: var(--danger-soft); border-color: var(--danger); }
.rich-tbar .tb-close { width: 30px; padding: 0; border-color: transparent; font-size: 18px; color: var(--ink-3); }

/* Envoi par e-mail : formulaire complet et historique */
.send-panel-full { width: min(520px, calc(100vw - 24px)); max-height: calc(100vh - 120px); overflow: auto; }
.send-form .send-to { grid-template-columns: 52px 1fr; align-items: center; gap: 8px; padding: 6px 12px; }
.send-form .send-to select, .send-form .send-to input { height: 34px; }
.send-body { display: block; padding: 6px 12px; }
.send-body textarea { width: 100%; min-height: 150px; padding: 8px 10px; border: 1px solid var(--rule); border-radius: var(--r-sm);
  font: 13.5px/1.45 var(--font-body); resize: vertical; text-align: left; }
.send-receipt { display: flex; align-items: center; gap: 8px; padding: 4px 12px 10px; font-size: 13.5px; text-align: left; }
.drop-row-main span { color: var(--action); }
.send-note { margin: 4px 12px 10px; text-align: left; }
@media (max-width: 760px) { .send-form .send-to { grid-template-columns: 1fr; } }

.mail-history-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.mail-history-head h2 { margin: 0; }
.mail-history-head form { margin: 0; }
.mail-list { margin: 0; padding: 0; list-style: none; }
.mail-item { display: grid; grid-template-columns: 150px minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-top: 1px solid var(--rule-2); }
.mail-item:first-child { border-top: 0; }
.mail-state { align-self: start; justify-self: start; padding: 3px 9px; border-radius: 12px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.mail-envoye .mail-state { background: var(--ok-soft); color: var(--ok); }
.mail-echec .mail-state { background: var(--danger-soft); color: var(--danger); }
.mail-prepare .mail-state { background: var(--rule-2); color: var(--ink-2); }
.mail-line { margin: 0 0 2px; overflow-wrap: anywhere; }
.mail-error { color: var(--danger); font-size: 13px; }
.mail-body summary { cursor: pointer; font-size: 13px; color: var(--action); }
.mail-body pre { margin: 6px 0 0; padding: 10px 12px; max-height: 260px; overflow: auto; background: var(--bg, #f6f6f3);
  border-radius: var(--r-sm); font: 13px/1.45 var(--font-body); white-space: pre-wrap; }
.mail-receipt { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.mail-receipt form { margin: 0; }
@media (max-width: 760px) {
  .mail-item { grid-template-columns: 1fr; }
  .mail-receipt { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Contrôle qualité (FAT / SAT) */
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.qc-parts { display: grid; gap: 22px; }
.qc-part-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.qc-part-head h3 { margin: 0; font: 600 18px/1.2 var(--font-din); }
.qc-part-head h3 small { color: var(--ink-3); font-weight: 500; }
.qc-part-head form { margin: 0; }
.qc-part + .qc-part { padding-top: 18px; border-top: 1px solid var(--rule); }
.qc-counts .qc-fail, .qc-live .qc-fail b { color: var(--danger); font-weight: 700; }
.qc-pass { color: var(--ok); }
.qc-kind { margin: 0 0 12px; color: var(--ink-2); }
.qc-times > div { display: flex; align-items: center; gap: 8px; }
.qc-times input { flex: 1; min-width: 0; }
.qc-instruments input { width: 100%; min-width: 0; }
.qc-instruments td:nth-child(1) { min-width: 240px; }
.qc-check-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; }
.qc-check-head h2 { margin: 0; }
.qc-live { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.qc-section { position: relative; margin: 18px 0 0; padding: 0; border: 0; }
.qc-note { margin: 10px 0 4px 58px; font-style: italic; color: var(--ink-2); }
.qc-row {
  display: grid; grid-template-columns: 46px minmax(0, 1fr) auto minmax(180px, 260px); gap: 6px 12px; align-items: center;
  padding: 8px 0; border-bottom: 1px solid var(--rule-2);
}
.qc-row.is-fail { background: linear-gradient(90deg, var(--danger-soft), transparent 70%); }
.qc-num { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-2); padding-left: 4px; }
.qc-text { line-height: 1.4; }
.qc-choice { display: inline-flex; border: 1px solid var(--rule); border-radius: var(--r); overflow: hidden; }
.qc-opt { position: relative; margin: 0; cursor: pointer; }
.qc-opt input { position: absolute; opacity: 0; pointer-events: none; }
.qc-opt span { display: block; min-width: 50px; padding: 6px 9px; text-align: center; font-size: 12.5px; font-weight: 700; color: var(--ink-3); background: #fff; }
.qc-opt + .qc-opt span { border-left: 1px solid var(--rule); }
.qc-opt input:focus-visible + span { box-shadow: inset 0 0 0 2px var(--action); }
.qc-opt:hover span { background: var(--rule-2); }
.qc-pass input:checked + span { background: var(--ok); color: #fff; }
.qc-fail input:checked + span { background: var(--danger); color: #fff; }
.qc-na input:checked + span { background: var(--ink-2); color: #fff; }
.qc-opt input:disabled + span { cursor: default; }
.qc-remark { width: 100%; min-width: 0; height: 32px; padding: 0 8px; border: 1px solid var(--rule); border-radius: var(--r-sm); font: inherit; font-size: 13px; }
.qc-outcomes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.qc-outcome { position: relative; cursor: pointer; }
.qc-outcome input { position: absolute; opacity: 0; }
.qc-outcome span { display: block; padding: 9px 16px; border: 1px solid var(--rule); border-radius: var(--r); font-weight: 600; background: #fff; }
.qc-outcome input:focus-visible + span { box-shadow: var(--focus); }
.qc-o-conforme input:checked + span { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }
.qc-o-reserves input:checked + span { background: var(--warn-soft); border-color: var(--warn); color: #6d4700; }
.qc-o-non_conforme input:checked + span { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
@media (max-width: 900px) {
  .qc-row { grid-template-columns: 40px minmax(0, 1fr); }
  .qc-choice, .qc-remark { grid-column: 2; }
}

/* Onglets nombreux (fiche projet) : sur une ligne, défilement horizontal si l'écran est étroit */
.tabs { overflow-x: auto; scrollbar-width: thin; }
.tabs a { white-space: nowrap; flex: none; }
.c-projets.tabs { gap: 0; }
.c-projets.tabs a { padding-left: 11px; padding-right: 11px; font-size: 14px; gap: 5px; }
.qc-sec-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin: 18px 0 0; padding: 0 0 6px; border-bottom: 2px solid var(--ink); }
.qc-sec-head h3 { margin: 0; font: 600 16px var(--font-din); }

/* Factures fournisseurs */
.pinv-drop { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; margin: 0;
  padding: 22px 24px; border: 2px dashed var(--rule); border-radius: var(--r); background: #fafaf8; }
.pinv-drop.is-over, body.is-dragging-files .pinv-drop { border-color: var(--action); background: var(--action-soft); }
.pinv-drop-text { display: grid; gap: 4px; max-width: 72ch; }
.pinv-drop-text strong { font: 600 18px var(--font-din); }
.pinv-drop-text span { color: var(--ink-2); font-size: 14px; }
.pinv-pick { cursor: pointer; }
.pinv-inbox { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; margin: 12px 0 0; }
.pinv-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.pinv-form { display: contents; }
.pinv-layout > .panel, .pinv-form > .panel { margin: 0; }
.pinv-form > #lignes, .pinv-form > .sticky-actions { grid-column: 1 / -1; }
@media (min-width: 1100px) { .pinv-layout:has(.pinv-preview) { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; } }
.pinv-preview { padding: 0; overflow: hidden; min-height: 520px; }
.pinv-preview iframe { display: block; width: 100%; height: 100%; min-height: 520px; border: 0; }
.pinv-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; margin-bottom: 8px; }
.pinv-head h2 { margin: 0; }
.pinv-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.found { font-weight: 500; color: var(--ok); }
.pinv-checks { margin: 4px 0 10px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.pinv-checks li::before { margin-right: 5px; font-weight: 700; }
.chk-ok { color: var(--ok); } .chk-ok::before { content: "✓"; }
.chk-warn { color: #8a5b00; } .chk-warn::before { content: "!"; }
.chk-bad { color: var(--danger); } .chk-bad::before { content: "✕"; }
.chk-info { color: var(--ink-3); } .chk-info::before { content: "·"; }
.pinv-orders { margin: 12px 0 0; padding: 10px 0 0; border: 0; border-top: 1px solid var(--rule-2); display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pinv-orders legend { padding: 0; margin-bottom: 6px; font-weight: 600; float: left; width: 100%; }
.pinv-lines input { width: 100%; min-width: 0; }
.pinv-lines td:nth-child(1) { width: 120px; }
.pinv-lines td:nth-child(2) { min-width: 200px; }
.pinv-lines td:nth-child(3), .pinv-lines td:nth-child(4), .pinv-lines td:nth-child(5) { width: 92px; }
.pinv-match { min-width: 300px; }
.pinv-match select { width: 100%; }
.pinv-match .pinv-checks { margin: 4px 0 0; }
.pinv-lines tr.is-matched td:first-child { box-shadow: inset 3px 0 0 var(--ok); }
.pinv-notes { display: block; margin-top: 12px; }

/* Avertissement de fin de session */
.session-bar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 400; display: flex; align-items: center;
  gap: 14px; max-width: calc(100vw - 32px); padding: 10px 12px 10px 16px; border: 1px solid var(--warn); border-radius: 8px;
  background: var(--warn-soft); color: var(--ink); box-shadow: 0 6px 24px rgba(0, 0, 0, .18); font-size: .95rem; }
.session-bar[hidden] { display: none; }
@media (max-width: 600px) { .session-bar { flex-direction: column; align-items: stretch; text-align: center; } }

/* Import d'offres PDF */
.offer-dropband { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 10px 14px;
  border: 1.5px dashed var(--rule); border-radius: var(--r); background: var(--panel); font-size: 14px; }
.offer-dropband > span { flex: 1 1 320px; }
.offer-import-options { margin-top: 14px; }
.offer-import-options summary { cursor: pointer; font-weight: 600; margin-bottom: 10px; }
.offer-imported { border-left: 3px solid var(--action); }
.offer-imported-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px; }
.offer-imported-head p { margin: 0; flex: 1 1 360px; }

/* Contrôle qualité : double appui sans zoom sur tablette (double appui = effacer le résultat) */
.qc-opt { touch-action: manipulation; user-select: none; }

/* Onglet E-mails du projet */
.mail-head { flex-wrap: wrap; }
.mail-head .head-actions { padding: 0; }
.segmented a { padding: 6px 12px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; border-right: 1px solid var(--rule); }
.segmented a:last-child { border-right: 0; }
.segmented a[aria-current] { background: var(--action-soft); color: var(--ink); font-weight: 600; }
.mail-compose { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--rule); border-radius: var(--r); background: var(--bg); }
.mail-compose > summary { cursor: pointer; font-weight: 600; }
.mail-compose[open] > summary { margin-bottom: 12px; }
.mail-docs { margin-top: 8px; }
.mail-docs summary { cursor: pointer; font-size: 13.5px; color: var(--action); }
.mail-list tr.is-unread td { font-weight: 600; }
.mail-who { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tab-new { background: var(--action); color: #fff !important; border-radius: 999px; padding: 0 6px; font-size: 11.5px; }
.mail-meta { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 4px 12px; margin: 0 0 14px; font-size: 14px; }
.mail-meta dt { color: var(--ink-3); }
.mail-meta dd { margin: 0; overflow-wrap: anywhere; }
.mail-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; padding: 14px 0 0; border-top: 1px solid var(--rule); }
.mail-history { margin-top: 14px; }
.mail-history summary { cursor: pointer; color: var(--action); font-size: 13.5px; }
.mail-atts { margin: 0 0 12px; }
.mail-atts ul { margin: 6px 0 10px; padding: 0; list-style: none; }
.mail-atts li { display: flex; align-items: center; gap: 8px; padding: 3px 0; }

/* En-tête blanc toujours visible au défilement ; sur la fiche projet, la barre d'onglets reste juste en dessous */
.app-head { position: sticky; top: var(--topbar-h); z-index: 30; }
.tabs.c-projets { position: sticky; top: calc(var(--topbar-h) + var(--app-head-h, 0px)); z-index: 29;
  background: var(--bg); padding-top: 8px; margin-top: -8px; }
@media (max-width: 700px), (max-height: 620px) {
  .app-head, .tabs.c-projets { position: static; }
}
@media print { .app-head, .tabs.c-projets { position: static; } }

/* Onglets : chaque onglet délimité, les onglets non sélectionnés bien lisibles */
.tabs { gap: 4px; }
.c-projets.tabs { gap: 3px; }
.c-projets.tabs a { padding: 9px 9px; font-size: 13.5px; gap: 4px; }
.tabs a {
  border: 1px solid #c6cbc4; border-bottom: 0; background: #dcdfda; color: #34404a; font-weight: 500;
}
.tabs a:hover { background: #f3f5f7; color: var(--ink); }
.tabs a small { color: #5d6873; }
.tabs a[aria-selected="true"] { background: var(--panel); border-color: var(--rule); color: var(--ink); font-weight: 600;
  box-shadow: inset 0 3px 0 #8a5a34; position: relative; }
.tabs a[aria-selected="true"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: var(--panel); }

/* Pièces jointes ajoutées à un e-mail, boutons d'ajout de destinataires */
.send-files { display: grid; gap: 4px; margin: 2px 0 8px; }
.send-files > span { font-size: 12.5px; color: var(--ink-3); }
.attach-list { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 4px; }
.attach-list[hidden] { display: none; }
.attach-list li { display: flex; align-items: center; gap: 8px; padding: 3px 4px 3px 10px; border: 1px solid var(--rule); border-radius: 4px; background: var(--panel); }
.attach-list li span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-list li small { color: var(--ink-3); }
.mail-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: -4px 0 4px; }
.chip-btn { padding: 3px 10px; border: 1px solid var(--rule); border-radius: 999px; background: var(--panel); color: var(--ink); font: inherit; font-size: 12.5px; cursor: pointer; }
.chip-btn:hover, .chip-btn:focus-visible { border-color: var(--action, #1d5fa8); color: var(--action, #1d5fa8); }
.panel-grid > .panel-wide { grid-column: 1 / -1; }
.signature-form textarea { font: inherit; line-height: 1.5; max-width: 640px; }
/* Historique du stock : modifications manuelles bien visibles */
#moves-table tr.move-manual > td:first-child { box-shadow: inset 3px 0 0 #c98a14; }
#moves-table tr.move-deleted > td { color: var(--ink-3); }
#moves-table tr.move-deleted > td:first-child { box-shadow: inset 3px 0 0 #b3261e; }
/* Emplacements du stock en arborescence */
.loc-add { display: grid; grid-template-columns: minmax(200px, 1fr) minmax(200px, 1.4fr) auto; gap: 10px; align-items: end; }
@media (max-width: 700px) { .loc-add { grid-template-columns: 1fr; } }
.loc-name { white-space: normal; }
.loc-d1 { padding-left: 34px !important; } .loc-d2 { padding-left: 58px !important; } .loc-d3 { padding-left: 82px !important; }
.loc-d4 { padding-left: 106px !important; } .loc-d5 { padding-left: 130px !important; } .loc-d6 { padding-left: 154px !important; }
.loc-d7 { padding-left: 178px !important; } .loc-d8 { padding-left: 202px !important; }
.loc-branch { color: var(--ink-3); margin-right: 6px; }
.loc-table tr.is-off td { color: var(--ink-3); }
.loc-panel { display: grid; gap: 12px; min-width: 300px; text-align: left; }
.loc-panel form { display: grid; gap: 6px; }
.loc-panel-end { display: flex !important; gap: 8px; justify-content: space-between; border-top: 1px solid var(--rule); padding-top: 8px; }
.loc-table details[open] { z-index: 20; }
.loc-table .loc-panel { z-index: 20; padding: 12px; }
.loc-table td:last-child { position: relative; }
.seq-table .w-prefix { width: 180px; }
.renumber-panel { display: grid; gap: 8px; padding: 12px; min-width: 260px; z-index: 20; }
.head-actions .renumber-panel, .renumber .renumber-panel { display: grid !important; grid-template-columns: 1fr; width: 300px; align-items: stretch; }
.renumber-panel .field { width: 100%; }
.renumber-panel small { white-space: normal; line-height: 1.4; }
.link-requests { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.rec-loc { min-width: 180px; max-width: 280px; }
/* En-tête de tableau collé en haut pendant le défilement (copie gérée par erp.js) */
.thead-float { position: fixed; z-index: 11; overflow: hidden; background: var(--panel); box-shadow: 0 3px 6px -3px rgba(20, 30, 36, .25); }
.thead-float[hidden] { display: none; }
.thead-float-table { margin: 0; table-layout: fixed; background: var(--panel); }
.thead-float-table th { background: var(--panel); }
@media print { .thead-float { display: none !important; } }
.link-line { display: flex; gap: 6px; align-items: center; margin-top: 4px; }
.link-line select { min-width: 220px; max-width: 340px; font-size: 13px; }
/* Emplacements : tableau sur toute la hauteur (pas de zone à défilement), le panneau « Modifier » déborde librement */
.loc-wrap { overflow: visible; }
.loc-table { width: 100%; }
.loc-table .loc-panel { max-height: none; }
@media (max-width: 700px) { .loc-wrap { overflow-x: auto; } }
.retry { display: inline-block; margin-top: 6px; position: relative; }
.retry-panel { display: grid; gap: 8px; padding: 12px; width: 380px; z-index: 30; left: auto; right: 0; }
.retry-panel p { margin: 0; white-space: normal; }
.retry .retry-panel { position: static; box-shadow: none; margin-top: 8px; width: auto; max-width: 460px; }
.order-row.order-avenant { margin-left: 26px; }
.order-row { flex-wrap: wrap; } .order-row .file-chip { white-space: nowrap; }
.order-offer { flex-basis: 100%; margin: 0 !important; }
.order-offer select { font-size: 13px; padding: 4px 8px; max-width: 100%; }
.order-row .order-offer { order: 5; }
/* Facture : contrôle avant envoi */
.send-check.is-ok { border-left: 4px solid #2e7d4f; }
.send-check.is-ko { border-left: 4px solid #b3261e; }
.check-list { list-style: none; margin: 0 0 12px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 4px 18px; }
.check-list li::before { display: inline-block; width: 1.3em; font-weight: 700; }
.check-list li.chk-ok::before { content: "✓"; color: #2e7d4f; }
.check-list li.chk-ko::before { content: "✗"; color: #b3261e; }
.check-list li.chk-warn::before { content: "!"; color: #c98a14; }
.send-check-form { display: grid; gap: 8px; border-top: 1px solid var(--rule); padding-top: 12px; }
.send-check-form .is-off { color: var(--ink-3); }
.file-chip-none { border-style: dashed; color: var(--ink-2); } .order-attach { margin: 0; }

/* Facture : cadre « Projet et offre » */
.inv-link summary { cursor: pointer; }
.inv-link form { margin-top: 12px; }
.inv-link-missing { border-left: 4px solid #c98a14; }

/* Ligne du temps : dernière étape en retard (facture non payée après l'échéance) */
.tl-step.is-late .tl-dot { background: #fff; border-color: #d9822b; color: #c2410c; box-shadow: 0 0 0 4px #fdebd8; }
.tl-step.is-late .tl-label, .tl-step.is-late .tl-hint-mark { color: #c2410c; font-weight: 600; }
.tl-step.is-very-late .tl-dot { background: var(--danger); border-color: var(--danger); color: #fff; box-shadow: 0 0 0 4px var(--danger-soft); }
.tl-step.is-very-late .tl-label, .tl-step.is-very-late .tl-hint-mark { color: var(--danger); font-weight: 700; }

/* Barre « Enregistrer » montée dans l'en-tête, à gauche des flèches précédent / suivant */
.head-row { display: flex; align-items: center; justify-content: flex-end; gap: 14px; flex-wrap: wrap; }
.head-side .sticky-actions.is-in-head {
  position: static; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; border: 0; border-radius: 0;
  background: none; box-shadow: none;
}
.head-side .sticky-actions.is-in-head[hidden] { display: none; }
.head-side .sticky-actions.is-in-head .push-right { margin-left: 0; }
.fiche-info { margin: 4px 2px 0; }
@media (max-width: 760px) { .head-row { justify-content: flex-start; } }

/* Demande de prix : suite (bon de commande, autre fournisseur, annuler) */
.dp-next { display: grid; gap: 18px; }
.dp-order { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.dp-other { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.dp-other .field { min-width: 280px; }
.bill-strip .bill-unpaid dd { color: #b45309; }
.bill-strip .bill-late { color: var(--danger, #b5372b); font-weight: 600; }
@media (max-width: 760px) { .bill-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Apparence (Mon profil) */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 16px; }
.theme-color { display: flex; align-items: center; gap: 10px; font-size: 14px; cursor: pointer; }
.theme-color input[type=color] { width: 44px; height: 32px; padding: 2px; border: 1px solid var(--rule); border-radius: var(--r-sm); background: var(--panel); cursor: pointer; }
.theme-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.theme-preset { display: inline-flex; align-items: center; gap: 8px; }
.theme-swatch { width: 26px; height: 18px; border-radius: 3px; border: 1px solid rgba(0,0,0,.15); background: linear-gradient(90deg, #222c33 50%, #2c64a8 50%); }
.theme-swatch-marine { background: linear-gradient(90deg, #16263f 50%, #1f5fa8 50%); }
.theme-swatch-foret { background: linear-gradient(90deg, #1d3326 50%, #2b7a4b 50%); }
.theme-swatch-chaud { background: linear-gradient(90deg, #2e2824 50%, #b0561f 50%); }
.theme-swatch-contraste { background: linear-gradient(90deg, #000 50%, #0b4fb3 50%); }
