/* Back-office Devis — ECRP GROUP (ENCORP) */

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: #eef0f4;
  color: #23262e;
}
button { font-family: inherit; }
input, select, textarea { font-family: inherit; accent-color: var(--acc1); }
.hidden { display: none !important; }

/* ---------- bandeau haut ---------- */
.band {
  background: linear-gradient(120deg, #14161c 0%, #23262e 55%, #3a2a1a 100%);
  padding: 14px 26px;
  display: flex; align-items: center; justify-content: space-between;
}
.band-left { display: flex; align-items: center; gap: 18px; }
.band-left img.logo { height: 36px; display: block; }
.band-left h1 { color: #fff; font-size: 19px; font-weight: 700; letter-spacing: .4px; }
.band-left h1 .grad {
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: var(--acc1);
}
.band-right { display: flex; align-items: center; gap: 12px; flex-wrap: nowrap; }
.pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 13px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: #e6e8ee;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.16);
}
.pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #9aa0ab; }
.pill-api::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.22); }
.pill-local::before { background: #9aa0ab; }

/* ---------- onglets ---------- */
.tabs { display: flex; gap: 10px; padding: 16px 26px 4px; max-width: 1280px; margin: 0 auto; }
.tab {
  border: 1px solid #dfe2e8; background: #fff; color: #5a5e68;
  font-size: 13px; font-weight: 700; letter-spacing: 1px;
  padding: 11px 30px; border-radius: 12px; cursor: pointer;
}
.tab:hover { border-color: #c4c9d2; }
.tab.active {
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px var(--acc2-a35);
}

/* ---------- structure ---------- */
main { max-width: 1280px; margin: 0 auto; padding: 12px 26px 60px; }
.card {
  background: #fff; border-radius: 16px; padding: 20px 24px;
  margin: 14px 0 18px; box-shadow: 0 2px 10px rgba(20,22,28,.06);
}
.card h2 {
  display: flex; align-items: center; gap: 10px;
  font-size: 14px; text-transform: uppercase; letter-spacing: 1.2px;
  color: #14161c; margin-bottom: 16px;
}
.card h2::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px;
  background: linear-gradient(120deg, var(--acc1), var(--acc2));
}
.card-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; flex-wrap: wrap; gap: 10px; }
.card-toolbar h2 { margin-bottom: 0; }
.card-toolbar .tools { display: flex; align-items: center; gap: 10px; }
.hint { font-size: 12px; color: #8a8f9a; margin-top: 6px; line-height: 1.4; }

/* ---------- boutons ---------- */
.btn {
  background: #fff; border: 1px solid #d5d9e0; border-radius: 10px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: #23262e;
  cursor: pointer; white-space: nowrap;
}
.btn:hover { background: #f7f8fa; border-color: #b9bec8; }
.btn-primary {
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  color: #fff; border: none; padding: 11px 24px;
  box-shadow: 0 4px 12px var(--acc2-a30);
}
.btn-primary:hover { background: linear-gradient(90deg, #ff8b35, #ee4a60); }
.btn-primary.attn { box-shadow: 0 0 0 4px var(--acc1-a35), 0 4px 12px var(--acc2-a30); }
.btn-danger { background: var(--acc2); color: #fff; border: none; }
.btn-danger:hover { background: #f04a60; }
.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-del { color: var(--acc2); border-color: #f2c4cc; }
.btn-del:hover { background: #fdeef0; border-color: #e8a2ae; }

/* ---------- tableaux ---------- */
.tbl-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  background: #14161c; color: #fff; font-size: 11px; text-transform: uppercase;
  letter-spacing: .6px; padding: 10px 12px; text-align: left; white-space: nowrap;
}
.tbl th:first-child { border-radius: 8px 0 0 8px; }
.tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 10px 12px; border-bottom: 1px solid #eceef2; font-size: 14px; vertical-align: middle; }
.tbl tbody tr:hover { background: #fbf6ef; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl-wrap { padding-bottom: 18px; } /* marge sous la dernière ligne : la barre de défilement horizontal ne la recouvre plus */
.tbl .num, .tbl td.num { text-align: right; white-space: nowrap; }
.tbl .mono { font-family: Consolas, "Courier New", monospace; font-size: 13px; color: #4a4e58; white-space: nowrap; }
.tbl .cname { font-weight: 600; }
.tbl .acts { white-space: nowrap; text-align: right; }
.tbl .acts .btn { margin-left: 4px; }
.per { font-size: 11px; color: #8a8f9a; }
.empty { padding: 26px; text-align: center; color: #9aa0ab; font-style: italic; font-size: 14px; }

/* ---------- badges & chips ---------- */
.badge {
  border: none; cursor: pointer; color: #fff; font-weight: 700;
  font-size: 12px; padding: 6px 14px; border-radius: 999px;
}
.st-draft { background: #8a8f9a; }
.st-sent { background: #1f5fa8; }
.st-accepted { background: #1e8e5a; }
.st-refused { background: var(--acc2); }
.chip {
  display: inline-block; font-size: 11px; font-weight: 700;
  padding: 4px 11px; border-radius: 999px; color: #fff; letter-spacing: .4px;
}
.chip-lang { background: #f1f2f6; color: #5a5e68; }
.ty-once { background: var(--acc-mid); }
.ty-monthly { background: #1f5fa8; }
.ty-yearly { background: #1e8e5a; }
.dot-on { color: #1e8e5a; font-weight: 700; }
.dot-off { color: #9aa0ab; }

/* ---------- champs ---------- */
.fld { margin-bottom: 12px; }
.fld label {
  display: block; font-size: 11px; text-transform: uppercase; font-weight: 700;
  color: #8a8f9a; letter-spacing: .5px; margin-bottom: 5px;
}
.fld input[type="text"], .fld input[type="password"], .fld input[type="date"], .fld input[type="number"],
.fld select, .fld textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d5d9e0; border-radius: 9px;
  font-size: 14px; background: #fff; color: #23262e;
}
.fld textarea { resize: none; overflow: hidden; line-height: 1.4; }
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--acc1); box-shadow: 0 0 0 3px var(--acc1-a18);
}
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 16px; }
.search {
  width: 260px; padding: 9px 14px; border: 1px solid #d5d9e0; border-radius: 999px;
  font-size: 14px;
}
.search:focus { outline: none; border-color: var(--acc1); box-shadow: 0 0 0 3px var(--acc1-a18); }
label.chk {
  display: flex; align-items: center; gap: 9px; font-size: 14px;
  padding: 6px 0; cursor: pointer;
}
label.chk input { width: 17px; height: 17px; }
.blocks-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 20px; }

/* ---------- éditeur de devis ---------- */
.ed-head { display: flex; gap: 18px; flex-wrap: wrap; align-items: flex-end; }
.ed-head .fld { margin-bottom: 4px; }
.ed-num {
  font-family: Consolas, "Courier New", monospace; font-weight: 700; font-size: 15px;
  background: #f1f2f6; border-radius: 9px; padding: 9px 14px; letter-spacing: .5px;
}
.langbtns { display: flex; }
.lang-btn {
  padding: 9px 15px; border: 1px solid #d5d9e0; background: #fff;
  font-weight: 700; font-size: 13px; cursor: pointer; color: #5a5e68;
}
.lang-btn:first-child { border-radius: 9px 0 0 9px; }
.lang-btn:last-child { border-radius: 0 9px 9px 0; }
.lang-btn + .lang-btn { border-left: none; }
.lang-btn.active {
  background: linear-gradient(90deg, var(--acc1), var(--acc2));
  color: #fff; border-color: transparent;
}
.vat-pick { display: flex; gap: 8px; align-items: center; }
.vat-pick select { width: auto; }
.vat-pick input[type="number"] { width: 88px; }
.client-pick { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.client-pick select {
  flex: 1; min-width: 240px; max-width: 460px; padding: 9px 11px;
  border: 1px solid #d5d9e0; border-radius: 9px; font-size: 14px;
}

.lines-toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cat-search-wrap { position: relative; flex: 1; min-width: 200px; }
.cat-search-wrap .search { width: 100%; }
.cat-suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 40;
  background: #fff; border-radius: 12px; padding: 6px; max-height: 360px; overflow-y: auto;
  box-shadow: 0 12px 34px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.06);
}
.cs-row {
  display: grid; grid-template-columns: 90px minmax(0, 1fr) auto; gap: 10px; align-items: center; width: 100%;
  min-height: 52px; padding: 6px 10px; border: 0; border-radius: 8px; background: transparent; font: inherit; text-align: left; cursor: pointer;
}
.cs-row:hover { background: var(--acc-soft); }
.cs-ref { font-family: Consolas, monospace; font-size: 12px; color: #7b808c; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-lbl { min-width: 0; font-size: 13.5px; font-weight: 600; color: #23262e; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.cs-lbl small { display: block; font-weight: 400; font-size: 11.5px; color: #8a8f9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cs-price { font-size: 13px; font-weight: 700; text-align: right; white-space: nowrap; line-height: 1.3; }
.cs-price small { display: block; font-weight: 400; font-size: 10.5px; color: #8a8f9a; }
.cs-empty { padding: 8px 10px; font-size: 12.5px; color: #8a8f9a; }
/* champ + aide sur une seule ligne (gain de hauteur) */
.fld-inline { display: flex; flex-direction: row; align-items: center; gap: 14px; flex-wrap: wrap; }
.fld-inline input[type="text"] { width: 320px; max-width: 100%; }
.fld-inline .hint { margin: 0; flex: 1; min-width: 240px; }
.lines-toolbar select {
  min-width: 320px; padding: 9px 11px; border: 1px solid #d5d9e0;
  border-radius: 9px; font-size: 14px;
}
.lines-head, .line-row {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) 128px 64px 104px 40px 44px;
  gap: 8px; align-items: start;
}
.lines-head { padding: 0 10px 6px; }
.lines-head span {
  font-size: 10.5px; text-transform: uppercase; font-weight: 700;
  color: #8a8f9a; letter-spacing: .5px; padding-left: 2px;
}
.line-row { padding: 9px 10px; border-top: 1px solid #f0f1f5; border-radius: 8px; position: relative; transition: background .15s; }
.line-row:hover { background: var(--acc-soft); }
.line-row.dragging { opacity: .45; background: #ffe9d6; }
.l-act .l-mv { opacity: 0; transition: opacity .15s; }
.line-row:hover .l-mv, .line-row:focus-within .l-mv { opacity: 1; }
/* poignée : 2 colonnes de carrés arrondis (SVG), à cheval sur le bord gauche de la ligne ;
   « space » ne dessine que des tuiles entières : jamais de carré coupé en haut/bas */
.l-grip {
  position: absolute; left: -7px; top: 16px; bottom: 16px; width: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='7' viewBox='0 0 14 7'%3E%3Crect x='2' y='1.5' width='4' height='4' rx='1' fill='%23c3c8d2'/%3E%3Crect x='8' y='1.5' width='4' height='4' rx='1' fill='%23c3c8d2'/%3E%3C/svg%3E"); background-repeat: no-repeat space; background-position: center;
  cursor: grab; opacity: 0; transition: opacity .15s;
}
.l-grip:hover { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='7' viewBox='0 0 14 7'%3E%3Crect x='2' y='1.5' width='4' height='4' rx='1' fill='%238a8f9a'/%3E%3Crect x='8' y='1.5' width='4' height='4' rx='1' fill='%238a8f9a'/%3E%3C/svg%3E"); }
.line-row:hover .l-grip { opacity: 1; }
.l-grip:active { cursor: grabbing; }
@media (hover: none) { .l-act .l-mv, .l-grip { opacity: 1; } }
.l-qty, .l-price { text-align: right; font-variant-numeric: tabular-nums; }
.l-qty.long, .l-price.long { font-size: 11.5px; padding-left: 5px; padding-right: 6px; }
.l-qty.xlong, .l-price.xlong { font-size: 10px; letter-spacing: -.2px; padding-left: 4px; padding-right: 5px; }
.l-off { display: flex; align-items: center; justify-content: center; height: 34px; }
.lines-toolbar .search { flex: 1; min-width: 180px; }
.line-row.is-off { background: #effaf4; }
.line-row input, .line-row select, .line-row textarea {
  width: 100%; padding: 7px 9px; border: 1px solid #d5d9e0; border-radius: 8px;
  font-size: 13px; background: #fff;
}
.line-row input:focus, .line-row select:focus, .line-row textarea:focus {
  outline: none; border-color: var(--acc1); box-shadow: 0 0 0 2px var(--acc1-a18);
}
.line-row .l-desc {
  margin-top: 6px; resize: none; font-size: 12px; color: #5a5e68;
  line-height: 1.35; overflow: hidden;
}
.line-row .l-qty, .line-row .l-price { text-align: right; }
.line-row .l-off { display: flex; justify-content: center; align-items: center; height: 34px; padding: 0; }
.line-row .l-off input { width: 18px; height: 18px; cursor: pointer; }
.line-row .l-del { margin-top: 1px; }
.l-act { display: flex; flex-direction: column; gap: 4px; }
.l-act .l-mv { padding: 2px 0; font-size: 11px; line-height: 1.2; }
.lines-empty { padding: 20px; text-align: center; color: #9aa0ab; font-style: italic; font-size: 14px; }

/* ---------- totaux ---------- */
.totrow { display: flex; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.totbox { flex: 1; min-width: 230px; background: #f4f5f8; border-radius: 12px; padding: 14px 18px; }
.totbox.hl { background: linear-gradient(120deg, #14161c, #2c303b); color: #fff; }
.totbox .l1 {
  font-size: 11px; text-transform: uppercase; letter-spacing: .8px;
  font-weight: 700; color: #8a8f9a;
}
.totbox.hl .l1 { color: var(--acc-light); }
.totbox .rows { margin-top: 8px; }
.totbox .rows .r { display: flex; justify-content: space-between; font-size: 13px; line-height: 1.9; }
.totbox .rows .r.big { font-size: 17px; font-weight: 700; margin-top: 3px; }
.totbox.hl .rows .r.big b { color: #fff; }

/* ---------- barre d'actions ---------- */
.ed-actions { display: flex; gap: 10px; align-items: center; margin: 8px 0 30px; flex-wrap: wrap; }
.ed-actions .spacer { flex: 1; }
/* bouton Réglages : sticky en bas de l'écran, discret tant qu'il flotte */
#settings-actions { position: sticky; bottom: 14px; z-index: 20; pointer-events: none; margin-bottom: 8px; }
#settings-actions .btn { pointer-events: auto; transition: transform .15s, box-shadow .15s, opacity .15s; }
#settings-actions.is-stuck .btn {
  box-shadow: 0 10px 26px rgba(0,0,0,.28); opacity: .9; transform: scale(.92); transform-origin: right bottom;
}
#settings-actions.is-stuck .btn:hover { opacity: 1; transform: none; }
#settings-end { height: 1px; }

/* ---------- logo (réglages) ---------- */
.logo-row { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.logo-dark {
  background: linear-gradient(120deg, #14161c 0%, #23262e 70%, #3a2a1a 100%);
  border-radius: 12px; padding: 20px 30px;
}
.logo-dark img { height: 44px; max-width: 280px; display: block; object-fit: contain; }
.logo-ctl { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

/* ---------- toasts ---------- */
#toasts {
  position: fixed; right: 20px; bottom: 78px; z-index: 2000; /* au-dessus du bouton flottant des réglages */
  display: flex; flex-direction: column; gap: 10px; max-width: 420px;
}
.toast {
  background: #23262e; color: #fff; border-radius: 10px; padding: 13px 18px;
  font-size: 14px; line-height: 1.4; cursor: pointer;
  box-shadow: 0 6px 18px rgba(20,22,28,.35);
  border-left: 5px solid #1e8e5a;
  animation: toast-in .22s ease-out;
}
.t-warn { border-left-color: var(--acc-mid); }
.t-err { border-left-color: var(--acc2); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- modales ---------- */
.modal-ov {
  position: fixed; inset: 0; background: rgba(20,22,28,.55); z-index: 1000;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 16px; width: 640px; max-width: 94vw;
  max-height: 90vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(20,22,28,.35);
  animation: toast-in .18s ease-out;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px; border-bottom: 1px solid #eceef2;
}
.modal-head h3 { font-size: 16px; }
.modal-x {
  border: none; background: none; font-size: 24px; line-height: 1;
  cursor: pointer; color: #8a8f9a; padding: 2px 6px;
}
.modal-x:hover { color: var(--acc2); }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-foot {
  padding: 14px 22px; border-top: 1px solid #eceef2;
  display: flex; justify-content: flex-end; gap: 10px;
}
.confirm-txt { font-size: 14px; line-height: 1.55; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .grid2, .grid3, .blocks-grid { grid-template-columns: 1fr; }
  .lines-head, .line-row { grid-template-columns: 72px minmax(0, 1fr) 112px 56px 92px 34px 40px; }
  .search { width: 100%; }
}
@media (max-width: 720px) {
  .band { flex-direction: column; gap: 10px; }
  .tabs { padding: 12px 14px 2px; }
  main { padding: 8px 14px 50px; }
  .lines-head { display: none; }
  .line-row {
    grid-template-columns: 1fr 1fr 1fr; gap: 8px;
    grid-template-areas: "ref type type" "mid mid mid" "qty price off" "act act act";
  }
  .line-row .l-ref { grid-area: ref; }
  .line-row .l-type { grid-area: type; }
  .line-row .l-mid { grid-area: mid; }
  .line-row .l-qty { grid-area: qty; }
  .line-row .l-price { grid-area: price; }
  .line-row .l-off { grid-area: off; justify-content: flex-start; padding-left: 4px; }
  .line-row .l-act { grid-area: act; flex-direction: row; justify-content: flex-end; }
  .line-row .l-act .l-mv { opacity: 1; padding: 6px 14px; }
  .l-grip { display: none; }
}

/* sociétés émettrices (Réglages) */
.co-bar { display: flex; gap: 10px; margin-bottom: 12px; }
.co-bar .search { flex: 1; }
.co-bar select { flex: 1.3; }
.co-actions { margin-bottom: 14px; }
.co-actions .hint { margin: 0; }
/* clé API en responsive : champ pleine largeur, aide dessous */
@media (max-width: 720px) {
  .fld-inline { flex-direction: column; align-items: stretch; gap: 6px; }
  .fld-inline input[type="text"] { width: 100%; }
  .fld-inline .hint { min-width: 0; }
}

/* ---------- CORP-iQ : en-tête, utilisateur, connexion ---------- */
.band-left h1 .ver { font-size: 11px; font-weight: 600; color: #b8bdc9; margin-left: 2px; }
.band-left h1 .h1-sub { font-weight: 500; color: #cfd3dc; }
.pill-user em { font-style: normal; font-weight: 600; text-transform: none; letter-spacing: 0; color: #9aa0ab; margin-left: 4px; }
.pill-user::before { background: var(--acc1); }
.btn-ghost { background: transparent; color: #e6e8ee; border-color: rgba(255,255,255,.2); padding: 6px 10px; }
.btn-ghost:hover { background: rgba(255,255,255,.1); }
.login { position: fixed; inset: 0; z-index: 5000; background: #14161c; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; border-radius: 18px; padding: 22px 26px 26px; width: 380px; max-width: 100%; box-shadow: 0 24px 70px rgba(0,0,0,.5); }
.login-head { background: linear-gradient(120deg, #14161c, #2c303b); border-radius: 12px; padding: 16px; text-align: center; margin-bottom: 16px; }
.login-head img { height: 34px; }
.login-title { font-size: 22px; font-weight: 800; letter-spacing: .3px; text-align: center; }
.login-title small { font-size: 12px; font-weight: 600; color: #8a8f9a; }
.login-sub { text-align: center; font-size: 12px; color: #8a8f9a; text-transform: uppercase; letter-spacing: .8px; margin: 2px 0 18px; }
.login-err { background: #fff0ee; color: #b3122b; border-radius: 8px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px; }
.login-btn { width: 100%; justify-content: center; margin-top: 4px; }
.login-card input:-webkit-autofill { -webkit-box-shadow: 0 0 0 1000px #fff inset; box-shadow: 0 0 0 1000px #fff inset; }
.login-card .fld { margin-bottom: 14px; }

.chip.role-superuser { background: #14161c; color: #fff; }
.chip.role-admin { background: var(--acc1-a18); color: var(--acc-dark); }
.chip.role-commercial { background: #eef1f6; color: #4b5568; }

/* ---------- 5.2.0 : mobile & tablette ---------- */
@media (max-width: 1024px) {
  .band { padding: 12px 18px; }
  .tabs { padding: 14px 18px 2px; }
  .tab { padding: 11px 20px; }
  main { padding: 10px 18px 60px; }
  .card { padding: 18px 18px; }
}
@media (max-width: 720px) {
  html { overflow-x: hidden; }
  /* bandeau : logo + titre centrés, puis thème / utilisateur / boutons sur une ligne qui replie */
  .band { padding: 10px 14px 12px; gap: 8px; align-items: stretch; }
  .band-left { gap: 12px; justify-content: center; }
  .band-left img.logo { height: 28px; }
  .band-left h1 { font-size: 16px; white-space: nowrap; }
  .band-right { flex-wrap: wrap; justify-content: center; gap: 8px; }
  .pill { padding: 5px 10px; font-size: 10.5px; }
  /* menu Thème : ancré sur toute la largeur du bloc droit (sinon coupé par le bord) */
  .band-right { position: relative; }
  .theme-pick { position: static; }
  .theme-menu { left: 0; right: 0; min-width: 0; top: calc(100% + 8px); }
  /* onglets : trois boutons pleine largeur */
  .tabs { gap: 8px; }
  .tab { flex: 1; padding: 11px 6px; text-align: center; letter-spacing: .5px; font-size: 12.5px; }
  .card { padding: 14px 14px; border-radius: 12px; margin: 10px 0 14px; }
  .card-toolbar .tools { flex-wrap: wrap; }
  .card-toolbar .btn-primary { width: 100%; }
  /* champs à 16 px : iOS ne zoome plus au focus */
  .fld input[type="text"], .fld input[type="password"], .fld input[type="date"], .fld input[type="number"],
  .fld select, .fld textarea, .search, .client-pick select, .lines-toolbar select,
  .line-row input, .line-row select, .line-row textarea { font-size: 16px; }
  .btn-sm { padding: 8px 12px; font-size: 12.5px; }
  /* liste des devis : une carte par devis (le tableau reste le même HTML) */
  #view-quotes .tbl-wrap { overflow: visible; padding-bottom: 0; }
  #view-quotes .tbl thead { display: none; }
  #view-quotes .tbl, #view-quotes .tbl tbody { display: block; }
  #view-quotes .tbl tr {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; align-items: center;
    grid-template-areas: "num st" "client client" "date lang" "once monthly" "acts acts";
    padding: 12px 2px; border-bottom: 1px solid #eceef2;
  }
  #view-quotes .tbl tbody tr:hover { background: transparent; }
  #view-quotes .tbl td { display: block; padding: 0; border: 0; }
  #view-quotes .tbl td:nth-child(1) { grid-area: num; overflow: hidden; text-overflow: ellipsis; }
  #view-quotes .tbl td:nth-child(2) { grid-area: date; font-size: 12.5px; color: #8a8f9a; }
  #view-quotes .tbl td:nth-child(3) { grid-area: client; font-size: 15px; }
  #view-quotes .tbl td:nth-child(4) { grid-area: lang; text-align: right; }
  #view-quotes .tbl td:nth-child(5) { grid-area: once; }
  #view-quotes .tbl td:nth-child(6) { grid-area: monthly; }
  #view-quotes .tbl td:nth-child(7) { grid-area: st; text-align: right; }
  #view-quotes .tbl td:nth-child(8) { grid-area: acts; }
  #view-quotes .tbl td.num { text-align: left; font-size: 14px; font-weight: 600; }
  #view-quotes .tbl td:nth-child(5)::before, #view-quotes .tbl td:nth-child(6)::before {
    display: block; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; color: #8a8f9a;
  }
  #view-quotes .tbl td:nth-child(5)::before { content: "Unique HT"; }
  #view-quotes .tbl td:nth-child(6)::before { content: "Mensuel HT"; }
  #view-quotes .tbl td.empty { grid-column: 1 / -1; padding: 20px 0; }
  #view-quotes .tbl .acts { display: flex; flex-wrap: wrap; gap: 6px; white-space: normal; margin-top: 4px; }
  #view-quotes .tbl .acts .btn { margin: 0; flex: 1 1 28%; text-align: center; }
  #view-quotes .tbl .acts .btn-del { flex: 0 0 auto; }
  /* éditeur */
  .ed-head { gap: 10px; }
  .ed-head .fld { flex: 1 1 100%; }
  .ed-num { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .langbtns { width: 100%; }
  .lang-btn { flex: 1; text-align: center; padding: 10px 4px; }
  .client-pick select { min-width: 0; max-width: none; flex: 1 1 100%; }
  .lines-toolbar select { min-width: 0; width: 100%; }
  .totrow .totbox { min-width: 0; flex: 1 1 100%; }
  .ed-actions { gap: 8px; }
  .ed-actions .spacer { display: none; }
  .ed-actions .btn { flex: 1 1 45%; text-align: center; }
  .ed-actions .btn-primary { flex-basis: 100%; }
  /* réglages */
  .co-bar { flex-wrap: wrap; }
  .co-bar .search, .co-bar select { flex: 1 1 100%; }
  #settings-actions { bottom: 10px; }
  #settings-actions .btn { width: 100%; }
  #settings-actions.is-stuck .btn { transform: none; opacity: .95; }
  /* modales en feuille bas d'écran, toasts pleine largeur */
  .modal-ov { padding: 0; align-items: flex-end; }
  .modal-card { width: 100%; max-width: 100%; max-height: 92vh; border-radius: 18px 18px 0 0; }
  .modal-head, .modal-body, .modal-foot { padding-left: 16px; padding-right: 16px; }
  .modal-foot .btn { flex: 1; text-align: center; }
  #toasts { left: 12px; right: 12px; bottom: 70px; max-width: none; }
}
@media (max-width: 420px) {
  .band-left h1 .h1-sub { display: none; }
  .band-left img.logo { height: 24px; }
}
