/* =======================================================
   🧱 LAYOUT, SECTIONS & GRIDS
   ======================================================= */

/* Titres de section */
section h3 {
    font-weight: 200;
    margin: 0 0 10px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
section h3.sep {
    border-bottom: 1px solid var(--accent-200);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.contact-card {
  margin: 1rem 0;
}


/* Grilles génériques */
.row-grid {
  display: grid;
  gap: 12px;
}

.row-2 { grid-template-columns: repeat(2, 1fr); }
.row-3 { grid-template-columns: repeat(3, 1fr); }
.row-grid.row-4 { grid-template-columns: repeat(4, 1fr); }

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* Bloc dates devis */
.blocDateDevis {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  margin: 30px 0 10px;
}


/* =======================================================
   🧾 FORM FIELDS & HELPERS
   ======================================================= */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

.field label {
  font-size: 12px;
  opacity: 0.75;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.field .req {
  color: #ef4444;
}

.help {
  font-size: 12px;
  color: var(--muted);
}

/* Erreurs */
.error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.1);
}

/* Ligne texte simple (ligne de devis type "texte") */
.text-line {
  padding: 10px 12px;
  color: var(--muted);
}

/* Cas particulier des inputs numériques dans la modale */
.modal input#dureeValeur:focus,
.modal input#remiseValue:focus {
  outline: none;
  box-shadow: none !important;
  border: 0 !important;
}


/* =======================================================
   🧩 COMBO INPUTS & POPOVERS (Durée, Remise, etc.)
   ======================================================= */

/* Bouton d’unité type "jours / semaines / heures" */
.combo-unit {
  background: var(--panel);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  justify-content: space-between;
}

/* Popover générique (durée, menus, etc.) */
.popover {
  display: none;
  position: absolute;
  z-index: 100;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  margin-top: 4px;
}

.popover.open {
  display: flex;
  flex-direction: column;
}

.popover [role="menuitem"] {
  padding: 8px 12px;
  cursor: pointer;
  text-align: left;
}

.popover [role="menuitem"]:hover {
  background: var(--hover, color-mix(in srgb, var(--accent) 12%, transparent));
}



.type-badge .lucide {
  height: 16px;
  width: 16px; 
}
.type-badge  {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* Combo générique valeur + unité (utilisé aussi pour remise/acompte) */

.acompte-row,
.pay-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start; /* 🟢 aligne en haut du H3 */
}
.pay-badge, .deposit-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
} 

.pay-badge + .pay-badge {
  margin-left:6px
}

.input-combo {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 8px;
  /*overflow: hidden;*/
  min-height: 36px;
  background-color: var(--bg);
}

.input-combo:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

.combo-value {
  border: 0 !important;
  outline: 0;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  color: inherit;
  text-align: right;
  min-width: 120px;
}

.combo-value::-webkit-outer-spin-button,
.combo-value::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}



.combo-unit,
.field .combo-unit {
  border: 0;
  outline: 0;
  background: transparent;
  border-left: 1px solid var(--border);
  padding: 8px 10px;
}

/* Affinage spécifique à la zone de remise */
#remiseControlsRow .input-combo {
  border-radius: var(--radius);
  min-height: 36px;
}

#remiseControlsRow .input-combo:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
}

#remiseControlsRow .combo-value,
.field .combo-value {
  
  min-width: 0;
}

#remiseControlsRow .combo-value:focus,
.field .combo-value:focus {
  border-right: 1px solid var(--accent) !important;
}


/* =======================================================
   📦 GROUPES / SECTIONS DE LIGNES
   ======================================================= */

.group {
  border-bottom: 1px solid var(--border);
  padding: 0 0 14px 0;
}

.group-drag {
  cursor: grab;
  user-select: none;
}

.group-header {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in srgb, var(--accent) 75%, transparent);
  color: var(--textNeg);
  padding: 0 4px 0 12px;
}

.group-name {
    padding: 5px 11px !important;
    background: transparent !important;
    border: 0 !important;
    color: var(--panel) !important;
}
.group-title {
  display: flex;
  gap: 10px;
  align-items: center;
  font-weight: 600;

  color : rgb(52, 105, 173);
}

.group-title input {
  font-weight: 500;
  font-size: 14px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 6px 8px;
  border-radius: var(--radius);
  color: var(--textNeg);
}

.group-title input:focus {
  box-shadow: 0 0 0 3px rgba(253, 254, 255, 0.12);
}

.group-badge {
  font-size: 12px;
  color: var(--textNeg);
  background: linear-gradient(135deg, var(--accent));
  padding: 4px 8px;
  border-radius: 999px;
}

.group-actions {
  display: flex;
  gap: 17px;
  align-items: center;
  flex-wrap: wrap;
  z-index: 9999;
}

.group-links a {
  font-size: 12px;
  cursor: pointer;
}

.group-links a.muted {
  color: var(--muted);
}

tr.dragging,
.group.dragging {
  opacity: 0.6;
}




/* =======================================================
   📊 TABLEAU "CONSTRUCTOR" (LIGNES PRESTATIONS)
   ======================================================= */

.table.table-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.table.table-grid thead th {
  background: #f3f4f6;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  border: 1px solid var(--border);
  padding: 6px 8px;
  text-align: left;
}

.table.table-grid tbody td {

  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

/* Drag handle */
.drag-handle {
  cursor: grab;
  user-select: none;
  font-size: 16px;
  line-height: 1;
}

.table.table-grid td.drag-handle,
.table.table-grid td.menu-kebab {
  width: 36px;
  text-align: center;
  white-space: nowrap;
}

.table.table-grid td.drag-handle {
  padding-top: 10px;
}


.kebab-btn-prestations {
  padding-top: 20px !important;
}

/* Inputs dans la grille */
.table.table-grid input,
.table.table-grid select,
.table.table-grid textarea,
.table.table-grid .rte-editor {
  border: none;
  border-radius: 8px;
  width: 100%;
  padding: 6px 8px;
  box-sizing: border-box;
  outline: 0;
  background: var(--panel);
  color: var(--text);
  font-size: 0.8rem;
}

.cell-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Coins arrondis */
.table thead th:first-child {
  border-top-left-radius: var(--radius);
}

.table thead th:last-child {
  border-top-right-radius: var(--radius);
}

.table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--radius);
}

.table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--radius);
}

td.menu-kebab {
  border-right: 0 !important;
}

td.drag-handle {
  border-left: 0 !important;
}

.cell-total {
  text-align: right;
  padding-top: 22px;
  padding-right: 15px;
}

/* Colonne d’actions masquée en desktop */
.table.table-grid td.cell-actions {
  display: none;
}


/* =======================================================
   🧮 INPUTS NUMÉRIQUES (QTÉ / PU / UNITÉS / TVA)
   ======================================================= */

#sectionPrestation input {
  padding: 20px 6px;
}

/* Qté & PU HT */
.cell-qte input,
.cell-pu input {
  width: 100%;
  text-align: right;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cell-qte input:focus,
.cell-pu input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
  outline: none;
}



.cell-pu input[value$="€"] {
  font-style: italic;
}

/* Alignement numérique */
.in-qte,
.in-pu {
  text-align: right;
  font-variant-numeric: tabular-nums;
  padding-right: 4px;
}

.in-pu { min-width: 70px; }
.in-qte { width: 50px; }

/* Pickers unitaires / TVA */
.unit-picker,
.tva-picker {
  position: relative;
  display: inline-block;
  width: 100%;
}

.btn-unit,
.btn-tva {
  width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 0;
  border-radius: 6px;
  padding: 11px 8px;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  line-height: 1.4;
  margin-top: 12px;
}

.btn-unit:hover,
.btn-unit:focus,
.btn-tva:hover,
.btn-tva:focus {
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
}

.unit-popover,
.tva-popover {
  display: none;
  position: absolute;
  top: 105%;
  left: 0;
  min-width: 100%;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border, #ddd);
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  z-index: 100;
  padding: 4px 0;
}

.unit-popover button,
.tva-popover button {
  display: block;
  width: 100%;
  padding: 6px 10px;
  text-align: left;
  border: none;
  background: none;
  font-size: 13px;
  cursor: pointer;
}

.unit-popover button:hover,
.tva-popover button:hover {
  background: color-mix(in srgb, var(--accent) 45%, transparent);
  color: #fff;
}


/* =======================================================
   💰 TOTAUX & REMISE
   ======================================================= */

.totaux {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: flex-start;
}

.tot-box {
  min-width: 320px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
}

.tot-box .rowDevis {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 10px;
}

.tot-box .rowTot.grand strong {
  font-size: 18px;
}

/* Net à payer */
.tot-box .rowTot.net-payer {
  background: var(--accent);
  color: var(--textNeg);
  border-radius: 0 0 8px 8px;
  padding: 10px 12px;
  font-size: 1.1em;
  font-weight: 700;
  margin-top: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tot-box .rowTot.net-payer strong {
  font-size: 1.2em;
  font-weight: 600;
}

/* Boutons remise */

#removeDiscountLink {
  margin-left: 10px;
  margin-top: 10px;
}

/* Zone de contrôle de la remise */
#remiseControlsRow {
 
  border: 1px dashed var(--border);
  padding: 10px 0;
  margin: 6px 0 4px;
  align-items: center;
  justify-content: space-between;
  border-left: 0;
  border-right: 0;
}

#remiseControlsRow > div:first-child span {
  font-weight: 600;
  color: var(--text);
}

#remiseControlsRow select,
#remiseControlsRow input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  outline: 0;
  min-height: 36px;
}

#remiseControlsRow select:focus,
#remiseControlsRow input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

#remiseControlsRow input {
  width: 120px;
  text-align: right;
}

/* Résumé remise */
#remiseSummaryRow {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin: 10px;
}

#remiseSummaryLabel {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

#remiseSummaryLabel::before {
  content: "−";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fee2e2;
  color: #b91c1c;
  font-weight: 700;
  line-height: 1;
}

#remiseMontant {
  color: #b91c1c;
  font-weight: 700;
}


.statut-block {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1rem;
}

.statut-current {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--statut-color) 15%, var(--panel));
  border-left: 4px solid var(--statut-color);
  color: var(--text);
}

.statut-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sep {
  border: none;
  border-bottom: 1px solid var(--border);
  margin: 1rem 0;
}


/* =======================================================
   📜 CGV
   ======================================================= */

.cgv-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.cgv-editor {
     width: 100%;
    color: var(--muted);
    border-radius: 8px;
    padding: 8px 10px;
    outline: none;
    font: inherit;
    font-size: 0.8rem;
    border: 1px solid transparent;
}
.cgv-editor:focus {
  outline: none;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent);
  border: 1px solid var(--accent) !important;
}
.cgv-editor p {
    margin-block-start: 0.2rem;
    margin-block-end: 0.2rem;
}
.cgv-editor[contenteditable="true"] {
  min-height: 120px;
}



/* =======================================================
   📦 SECTION PRESTATION & HEADER TABLE
   ======================================================= */

#sectionPrestation {
  padding: 0;
  margin-top: 10px;
}

/* Header desktop */
.table.headerTablePrestation {
  margin: 0;
  width: 100%;
  background-color: var(--accent);
  color: var(--textNeg);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px 8px 0 0;
  overflow: hidden;
}

.table.headerTablePrestation thead th {
  font-weight: 600;
  text-transform: uppercase;
  padding: 10px 0;
  font-size: 0.9rem;
}

.headerTablePrestation thead th:first-child {
  border-top-left-radius: var(--radius);
}

.headerTablePrestation thead th:last-child {
  border-top-right-radius: var(--radius);
}

.headerTablePrestation th:nth-child(2),
.headerTablePrestation th:nth-child(4),
.headerTablePrestation th:nth-child(6) {
  text-align: left;
  padding-left: 10px !important;
}

.headerTablePrestation th:nth-child(3),
.headerTablePrestation th:nth-child(5),
.headerTablePrestation th:nth-child(7) {
  text-align: right;
  padding-right: 10px !important;
}

.headerTablePrestation th:nth-child(1),
.headerTablePrestation th:nth-child(8) {
  text-align: center;
}

/* Boutons ajout ligne */
#btnAddLineGlobal {
  background-color: var(--accent);
  color: var(--textNeg);
}

.btnAddLineSection {
  background-color: color-mix(in srgb, var(--accent) 45%, transparent) !important;
  color: var(--textNeg);
}

/* Placeholder prestations */
.presta-placeholder {
  text-align: center;
  padding: 0 20px;
  border-radius: 12px;
  margin: 15px 0;
  color: #777;
}

.presta-placeholder .big-icon {
  width: 30px;
  height: 30px;
  margin-bottom: 10px;
  color: var(--muted, #aaa);
}

.presta-placeholder p {
  font-size: 1em;
  margin: 0;
}

.presta-placeholder .placeholder-actions {
  margin-top: 15px;
  display: flex;
  justify-content: center;
  gap: 10px;
}

#prestaPlaceholder {
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}

#prestaPlaceholder.is-visible {
  display: flex;
}

/* Header mobile */
.mobile-presta-header {
  display: none;
}


/* =======================================================
   🔍 SUGGESTIONS — OVERLAY FLOTTANT TABLE
   ======================================================= */

.table.table-grid.suggest--fly {
  position: relative;
  padding: 0 5px;
}

.suggest-fly__wrap {
  position: absolute;
  left: 0;
  right: 0;
  z-index: 30;
  pointer-events: none;
}

.suggest-fly__card {
  margin: 0 0 8px 0;
  background: var(--panel);
  border-radius:  0 0 var(--radius)  var(--radius);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  transform-origin: top;
  transform: translateY(-6px) scaleY(0.98);
  opacity: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
  pointer-events: auto;
}

.suggest-fly__card.open {
  transform: translateY(0) scaleY(1);
  opacity: 1;
}

.suggest__inner {
  display: flex;
  flex-direction: column;
  padding: 0;
}

.suggest__search input {
  display: block;
  width: 100%;
  padding: 12px 14px !important;
  border: 0 !important;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  border-radius: 8px !important;
  outline: 0;
  background: var(--bg) !important;
}

.suggest__list {
  display: block;
}

.suggest__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  font-size: 13px;
  background-color: var(--panel);
}


.suggest__item:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.suggest__item:last-child {
  border-bottom: 0;
}

.suggest__empty {
  color: var(--muted);
  font-style: italic;
  padding: 14px;
}

.suggest__actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  background: var(--panel);
  border-top: 1px dashed var(--border);
}

.suggest__actions a {
  color: inherit;
  text-decoration: underline;
}


/* =======================================================
   🌐 AUTOCOMPLÉTIONS ADRESSE
   ======================================================= */

.addr-suggest {
  position: absolute;
  background: var(--panel);
  color: var(--text);
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  z-index: 10;
  display: none;
  max-height: 220px;
  overflow: auto;
}

.addr-item {
  padding: 10px 12px;
  cursor: pointer;
}

.addr-item:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Dropdown rendu dans <body> */
.addr-suggest-portal {
  position: absolute;
  z-index: 99999;
  display: none;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
  overflow: auto;
  max-height: 320px;
  line-height: normal;
  font-size: 14px;
}


.addr-suggest-portal .addr-item {
  display: block;
  padding: 10px 12px;
  cursor: pointer;
  line-height: 1.35;
}

.addr-suggest-portal .addr-item:hover {
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}


/* =======================================================
   🔍 AUTOCOMPLÉTION GLOBALE (Client / Projet / Artiste)
   ======================================================= */

.champ-autocompletion {
  position: relative;
  overflow: visible !important;
}

.champ-autocompletion .champ-input {
  width: 100%;
  padding-right: 56px;
}

.champ-autocompletion .btn-clear {
  position: absolute;
  right: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border: none;
  cursor: pointer;
}

.champ-autocompletion .input-chevron {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  opacity: 0.65;
  pointer-events: none;
}

/* Suggestion box (liste de clients/projets, etc.) */
.suggestion-box {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 30;
  background: var(--panel, #fff);
  border: 1px solid var(--border, #ddd);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  padding: 6px 0;
  max-height: 360px;
  overflow-y: auto;
  display: none;
}

.suggestion-box .suggest-item,
.suggestion-box .suggest-new,
.suggestion-box .suggest-empty {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.suggestion-box .suggest-item:hover,
.suggestion-box .suggest-new:hover {
  background: var(--hover, rgba(0, 0, 0, 0.04));
}

.suggestion-box .suggest-empty {
  color: var(--text-muted, #777);
  justify-content: center;
  cursor: default;
}

.suggestion-box .suggest-sep {
  height: 1px;
  margin: 4px 0;
  background: var(--border, #e2e2e2);
}

.suggestion-box .icon-inline {
  flex-shrink: 0;
  opacity: 0.75;
  width: 16px;
  height: 16px;
}

.suggestion-box .suggest-new {
  color: var(--accent, #4f46e5);
  font-weight: 500;
}

.suggestion-box .suggest-new .icon-inline {
  color: var(--accent, #4f46e5);
}

.suggestion-box .text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  flex: 1;
  overflow: hidden;
}

.suggestion-box .title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text, #222);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.suggestion-box .meta {
  font-size: 12.5px;
  color: var(--text-muted, #666);
  margin-top: 2px;
  line-height: 1.4;
}

.suggestion-box .meta .icon-inline {
  width: 13px;
  height: 13px;
  vertical-align: -1px;
  margin-right: 4px;
}

.suggestion-box .meta .accent {
  color: var(--accent, #4f46e5);
  font-weight: 500;
}

/* Scrollbar discrète */
.suggestion-box::-webkit-scrollbar {
  width: 6px;
}

.suggestion-box::-webkit-scrollbar-thumb {
  background: var(--border, #ccc);
  border-radius: 6px;
}

.suggestion-box::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted, #999);
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  .suggestion-box {
    background: var(--panel, #1f1f1f);
    border-color: var(--border, #333);
  }

  .suggestion-box .suggest-item:hover,
  .suggestion-box .suggest-new:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .suggestion-box .title {
    color: var(--text, #f5f5f5);
  }

  .suggestion-box .meta {
    color: var(--text-muted, #bbb);
  }
}


/* =======================================================
   👥 CLIENT / ARTISTE / PROJET — SECTIONS DUO
   ======================================================= */

#clientSection.duo,
#artisteSection.duo {
  padding: 4px 0;
  margin-bottom: 16px;
}

/* Grille interne */
#clientSection .duo-row,
#artisteSection .duo-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

/* Blocs (titre au-dessus) */
#clientSection .duo-block,
#artisteSection .duo-block {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  min-width: 0;
}

/* Titres */
.duo-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

 

#clientSection .duo-title h4,
#artisteSection .duo-title h4 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  letter-spacing: 0.02em;
  font-size: 1.2rem;
  font-weight: 400;
}

/* Corps */
#clientSection .duo-body,
#artisteSection .duo-body {
  flex: 1;
  min-width: 0;
}

/* Champ d'autocomplétion dans les DUO */
#clientSection .champ-autocompletion.field,
#artisteSection .champ-autocompletion.field {
  position: relative;
  display: flex;
  align-items: center;
  margin-top: 10px;
  background: var(--bg);
  border-radius: var(--radius);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
}

#clientSection .champ-autocompletion.field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 20%, transparent);
}

#clientSection .champ-input,
#artisteSection .champ-input {
  border: 1px solid var(--border);
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 14px;
  background: transparent;
}

/* Boutons clear spécifiques */
#clientSection .btn-clear,
#artisteSection .btn-clear {
  border: 0;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: var(--radius);
  line-height: 0;
  background: #fff;
}

#clientSection .btn-clear:hover,
#artisteSection .btn-clear:hover {
  background: #f8fafc;
}

/* Résumés sélectionnés */
#clientSection .client-summary,
#clientSection .project-summary,
#artisteSection .artiste-summary {
  display: none;
  align-items: flex-start;
  justify-content: space-between;
  background: var(--panel);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 10px 12px;
  min-height: 42px;
}

#clientSection .client-summary__name,
#artisteSection .artiste-summary__name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

#clientSection .client-summary__addr {
  color: var(--muted);
  font-size: 12px;
}

#clientSection .project-summary__left,
#artisteSection .artiste-summary__left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#clientSection .stack,
.project-summary .stack {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#clientSection .project-summary__name {
  font-weight: 600;
}

#clientSection .project-summary__dates {
  font-size: 12px;
}

#artisteSection .artiste-summary__left {
  display: flex;
  flex-direction: column;
}

#artisteSection .artiste-summary__meta {
  font-size: 12px;
  color: var(--muted);
}

/* Blocs sélectionnés (mode "compact") */
#clientSection .duo-block.is-selected .client-summary,
#clientSection .duo-block.is-selected .project-summary,
#artisteSection .duo-block.is-selected .artiste-summary {
  background: transparent;
  border: 0;
  padding: 0;
  box-shadow: none;
  min-height: 0;
  padding-top: 4px;
  padding-left: 15px;
  margin-bottom: 15px;
}

#clientSection .duo-block.is-selected .duo-title,
#artisteSection .duo-block.is-selected .duo-title,
#projetSection .duo-block.is-selected .duo-title {
  margin-top: -1px;
}

#clientSection .duo-block.is-selected .client-summary__name,
#clientSection .duo-block.is-selected .project-summary__name,
#artisteSection .duo-block.is-selected .artiste-summary__name {
  display: none;
}


/* =======================================================
   🟣 ICÔNES PASTILLES & BADGES CLIENT
   ======================================================= */

.icone-pastille-client,
.icone-pastille-projet,
.icone-pastille-artiste {
  width: 28px;
  height: 28px;
  display: flex;
  justify-content: center;
  align-items: center;
  color: var(--textNeg);
  border-radius: 999px;
  background: var(--accent);
}

.icone-pastille-client .lucide,
.icone-pastille-projet .lucide,
.icone-pastille-artiste .lucide {
  width: 28px !important;
  height: 28px !important;
}

.client-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  text-transform: uppercase;
  background: var(--accent);
}

.artiste-summary__meta,
.client-summary__addr,
.project-summary__meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.artiste-summary__meta .icon-inline,
.client-summary__addr .icon-inline,
.project-summary__meta .icon-inline {
  width: 14px;
  height: 14px;
  margin-right: 4px;
}

/* Fiche projet générique (hors duo) */
.project-summary {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
  animation: fadeIn 0.25s ease;
}

.project-summary__name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text, #222);
}

.project-summary__dates,
.project-summary__address {
  font-size: 13px;
  color: var(--text-muted, #666);
  line-height: 1.4;
}

.project-summary__meta .icon-inline,
.project-summary__dates .icon-inline,
.project-summary__address .icon-inline {
  width: 14px;
  height: 14px;
  vertical-align: -1px;
  margin-right: 4px;
  opacity: 0.8;
}


/* =======================================================
   🔁 TYPE DE DEVIS — TOGGLE
   ======================================================= */

.duo-block[data-type="type-devis"] .hd-toggle-quote {
  display: grid;
  grid-template-columns: auto 64px auto;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  user-select: none;
  font-weight: 600;
}

.duo-block[data-type="type-devis"] .hd-toggle-quote input[type="radio"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}

.duo-block[data-type="type-devis"] .hd-toggle-quote .opt {
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.2s ease, opacity 0.2s ease;
}

/* Toggle switch générique */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.toggle-switch input {
  display: none;
}

.toggle-switch .slider {
  width: 46px;
  height: 24px;
  background: #d1d5db;
  border-radius: 999px;
  position: relative;
  transition: background 0.3s;
}

.toggle-switch .slider::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.3s;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .slider {
  background: var(--accent);
}

.toggle-switch input:checked + .slider::before {
  transform: translateX(22px);
}

/* Labels toggle */
.toggle-label {
  font-size: 13px;
  display: flex;
  gap: 4px;
  color: var(--muted);
}

.toggle-label .estimatif {
  font-weight: 600;
}

.toggle-label .ferme {
  opacity: 0.5;
}

.toggle-switch input:checked ~ .toggle-label .ferme {
  opacity: 1;
  font-weight: 600;
  color: var(--accent);
}

.toggle-switch input:checked ~ .toggle-label .estimatif {
  opacity: 0.5;
  font-weight: normal;
}


/* =======================================================
   🪟 ENTÊTE OPTIONNELLE (ACCORDION)
   ======================================================= */

#enteteSection {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  will-change: max-height, opacity;
  padding: 0;
}

#enteteSection.is-open {
  opacity: 1;
}

#enteteSection .field {
  transform: translateY(-4px);
  transition: transform 0.25s ease;
}

#enteteSection.is-open .field {
  transform: translateY(0); 
}


/* =======================================================
   🧭 SEGMENTS (ONGLETS / BOUTONS)
   ======================================================= */

.seg {
  display: flex;
  gap: 20px;
  padding: 10px 0px;
  background: var(--panel);
  margin-bottom: 20px ;
}

.seg-btn {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--panel);
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
  text-transform: uppercase;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.seg-btn .lucide {
  width: 16px;
  height: 16px;
}
.seg-btn.active {
  background: var(--accent);
  color: var(--textNeg);
}


/* =======================================================
   📅 FLATPICKR (THEME + COMPACT)
   ======================================================= */

  .flatpickr-innerContainer{
    border-bottom:0 !important ;
  
  }
  .flatpickr-months .flatpickr-month {
    background: var(--accent) !important;
    color: var(--textNeg) !important;
  }
  .flatpickr-current-month .flatpickr-monthDropdown-months {
    background: var(--accent) !important;
    color: var(--textNeg) !important;
  }
.flatpickr-calendar {
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 9999;
}
span.flatpickr-weekday {
    color: var(--textNeg) !important;

}
.flatpickr-days {
  background: var(--bg) !important;

}
.flatpickr-day {
  color: var(--text) !important;
}
.flatpickr-day.prevMonthDay{
  color: color-mix(in srgb, var(--text) 60%, transparent) !important;
}
.flatpickr-day:hover {
    background:color-mix(in srgb, var(--accent) 25%, transparent) !important;
    border-color: color-mix(in srgb, var(--accent) 25%, transparent) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover,
.flatpickr-day.startRange,
.flatpickr-day.endRange {
  background: var(--accent) !important;
  border-color: var(--accent) !important;
  color: var(--textNeg) !important;
}

.flatpickr-day.inRange {
  background: rgba(37, 99, 235, 0.12);
  border-color: rgba(37, 99, 235, 0.12);
}


/* Compact */
.flatpickr-calendar.hd-compact {
  width: 240px;
  font-size: 12px;
  border-radius: 12px;
}

.flatpickr-calendar.hd-compact .flatpickr-months {
  height: 32px;
}

.flatpickr-calendar.hd-compact .flatpickr-current-month,
.flatpickr-calendar.hd-compact .flatpickr-monthDropdown-months,
.flatpickr-calendar.hd-compact .cur-year {
  font-size: 12px;
}

.flatpickr-calendar.hd-compact .flatpickr-weekday {
  font-size: 11px;
  padding: 2px 0;
}

.flatpickr-calendar.hd-compact .dayContainer {
  padding: 4px !important;
}

.flatpickr-calendar.hd-compact .flatpickr-days {
  width: auto !important;
}

.flatpickr-calendar.hd-compact .flatpickr-day {
  width: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  font-size: 12px !important;
  margin: 0 !important;
}

/* Header Flatpickr coloré */
.flatpickr-weekdays,
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
span.flatpickr-weekday {
  background-color: var(--accent) !important;
}
.flatpickr-months .flatpickr-prev-month:hover, .flatpickr-months .flatpickr-next-month:hover {
    color:var(--textNeg) !important;
}
.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {
     background-color: var(--accent) !important;
}

/* =======================================================
   🎬 ANIMATIONS
   ======================================================= */

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(15px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes slideOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(15px); }
}

@keyframes fadeInSlide {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInText {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeInScale {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

/* Utilitaires */
.hidden      { display: none; }
.animate-in  { animation: slideIn 0.2s ease; }
.animate-out { animation: slideOut 0.05s ease; }
.line-anim   { animation: fadeInSlide 0.3s ease-out; }
.text-anim   { animation: fadeInText 0.25s ease-in; }
.group-anim  { animation: fadeInScale 0.25s ease-out; }


/* =======================================================
   📱 RESPONSIVE
   ======================================================= */

/* Duo client/artiste sur 1 colonne */
@media (max-width: 960px) {
  #clientSection .duo-row,
  #artisteSection .duo-row {
    grid-template-columns: 1fr;
  }
}

/* Layout devis + tableau cartes */
@media (max-width: 900px) {

  .devis header {
    grid-template-columns: 1fr;
  }

  .row-4,
  .row-grid.row-4 {
    grid-template-columns: 1fr 1fr;
  }

  .totaux {
    grid-template-columns: 1fr;
  }

  /* Header mobile presta */
  .mobile-presta-header {
    display: block;
    margin: 0;
    width: 100%;
    background-color: var(--accent);
    color: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: hidden;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 14px;
    padding: 10px 14px;
  }

  .mobile-presta-header span {
    color: var(--panel) !important;
  }

  .headerTablePrestation {
    display: none;
  }

  /* Table → cartes */
  .table.table-grid {
    display: block;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
  }

  .table.table-grid tbody {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 5px;
  }

  .table.table-grid tr {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: auto;
    gap: 10px 12px;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
  }

  .table.table-grid td {
    width: auto !important;
    border: 0;
    padding: 0;
  }

  .table.table-grid td.designation-cell {
    grid-column: 1 / -1;
  }

  .table.table-grid td.designation-cell .type-badge {
    margin-bottom: 8px;
  }

  .table.table-grid td.designation-cell .rte {
    width: 100%;
  }

  .table.table-grid td.cell-qte  { grid-column: 1 / span 1; }
  .table.table-grid td.cell-unite{ grid-column: 2 / span 1; }
  .table.table-grid td.cell-pu   { grid-column: 3 / span 1; }
  .table.table-grid td.cell-tva  { grid-column: 4 / span 1; }

  .table.table-grid tbody td {
    border: 1px solid var(--border);
    border-radius: 6px;
  }

  .table.table-grid td.tdmenu-kebab,
  .table.table-grid td.drag-handle,
  .table.table-grid td.cell-total {
    display: none;
  }

  
  td.menu-kebab {
    display: none !important;
  }


  .table.table-grid td.cell-total strong {
    font-size: 16px;
  }

  .table.table-grid input,
  .table.table-grid select,
  .table.table-grid .rte-editor {
    width: 100%;
    border-radius: 4px;
  }

  .table.table-grid td.cell-actions {
    grid-column: 1 / -1;
    padding-top: 8px;
    display: block;
    border: 0;
  }

  .mobile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .move-btns {
    display: flex;
    gap: 6px;
  }

  .btn-move {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    background: #f9fafb;
    cursor: pointer;
  }

  .btn-move:hover {
    background: #f1f5f9;
  }

  .right-part {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .right-part .cell-total strong {
    font-size: 16px;
  }

  /* Lignes texte */
  .table.table-grid tr[data-kind="text"] {
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 10px;
    position: relative;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px 12px;
  }

  .table.table-grid tr[data-kind="text"] td {
    border: 0;
    padding: 0;
    width: auto !important;
  }

  .table.table-grid tr[data-kind="text"] td.drag-handle,
  .table.table-grid tr[data-kind="text"] td.menu-kebab,
  .table.table-grid tr[data-kind="text"] td.tdmenu-kebab {
    display: none !important;
  }

  .table.table-grid tr[data-kind="text"] .designation-cell {
    grid-column: 1 / -1;
  }

  .table.table-grid tr[data-kind="text"] .rte {
    display: block;
  }

  .table.table-grid tr[data-kind="text"] .rte-editor {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    min-height: 38px;
    line-height: 1.4;
  }

  .table.table-grid tr[data-kind="text"] td.cell-actions {
    grid-column: 1 / -1;
    display: block;
    padding-top: 8px;
  }

  .table.table-grid tr[data-kind="text"] .mobile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .table.table-grid tr[data-kind="text"] .move-btns {
    display: flex;
    gap: 6px;
  }

  .table.table-grid tr[data-kind="text"] .btn-move {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    background: #f9fafb;
    cursor: pointer;
  }

  .table.table-grid tr[data-kind="text"] .btn-move:hover {
    background: #f1f5f9;
  }

  .table.table-grid tr[data-kind="text"] .right-part {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  
 

  /* Lignes "line" (non texte) pour les actions mobiles */
  .table.table-grid tr[data-kind="line"] td.cell-actions {
    grid-column: 1 / -1;
    display: block;
    padding-top: 8px;
  }

  .table.table-grid tr[data-kind="line"] .mobile-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .table.table-grid tr[data-kind="line"] .move-btns {
    display: flex;
    gap: 6px;
  }

  .table.table-grid tr[data-kind="line"] .btn-move {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 2px 6px;
    background: #f9fafb;
    cursor: pointer;
  }

  .table.table-grid tr[data-kind="line"] .btn-move:hover {
    background: #f1f5f9;
  }

  .table.table-grid tr[data-kind="line"] .right-part {
    display: flex;
    align-items: center;
    gap: 12px;
  }


}

/* Petits écrans encore plus étroits (alignement remise, etc.) */
@media (max-width: 600px) {
  .row-2,
  .row-3,
  .row-4 {
    grid-template-columns: 1fr;
  }

  .infos .rowDevis {
    flex-direction: column;
    align-items: flex-start;
  }

  .type-grid {
    grid-template-columns: 1fr 1fr;
  }

  #remiseControlsRow {
    flex-direction: column;
    gap: 10px;
  }

  #remiseControlsRow > div:last-child {
    width: 100%;
    display: flex;
    gap: 8px;
  }

  #remiseControlsRow input {
    flex: 1;
  }

  .table.table-grid tr {
    grid-template-columns: repeat(2, 1fr);
  }

  .table.table-grid td.cell-qte  { grid-column: 1 / span 1; }
  .table.table-grid td.cell-unite{ grid-column: 2 / span 1; }
  .table.table-grid td.cell-pu   { grid-column: 1 / span 1; }
  .table.table-grid td.cell-tva  { grid-column: 2 / span 1; }
  .table.table-grid td.cell-total { display: none; }

  .table.table-grid tr[data-kind="text"] {
    padding: 12px 10px 10px;
  }

  .table.table-grid tr[data-kind="text"] .rte-editor {
    padding: 10px;
  }
}



.modal.closing,
.modal-backdrop.closing {
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.modal-backdrop {
  transition: opacity 0.25s ease;
}





/* ============================
   MODALE SUCCÈS DEVIS
   ============================ */

.devis-success-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55); /* voile sombre */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9998;
}

.devis-success-modal {
  background: var(--panel, #020617);
  color: var(--color-text, #e5e7eb);
  border-radius: 18px;
  box-shadow:
    0 24px 60px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(148, 163, 184, 0.12);
  max-width: 480px;
  width: 100%;
  padding: 22px 22px 18px;
  animation: devisSuccessIn 0.18s ease-out;
}

@keyframes devisSuccessIn {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.devis-success-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
}

.devis-success-icon {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4ade80;
}

.devis-success-icon .lucide {
  width: 22px;
  height: 22px;
}

.devis-success-title h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.devis-success-title p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.devis-success-body {
  margin-bottom: 16px;
}

.devis-success-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.devis-success-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  font-size: 0.78rem;
  white-space: nowrap;
}

.devis-success-tag .lucide {
  width: 14px;
  height: 14px;
}

/* Actions */
.devis-success-footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.devis-success-footer .primary-actions,
.devis-success-footer .secondary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Boutons – on part du principe que tu as déjà .btn,
   mais au cas où : */
.devis-success-footer .btn {
  border-radius: 999px;
  padding: 7px 14px;
  font-size: 0.85rem;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.devis-success-footer .btn-primary {
  background: var(--accent, #22c55e);
  color: #0b1120;
  font-weight: 600;
}

.devis-success-footer .btn-outline {
  background: transparent;
  border: 1px solid rgba(148, 163, 184, 0.6);
  color: #e5e7eb;
}

.devis-success-footer .btn-ghost {
  background: transparent;
  color: #9ca3af;
}

.devis-success-footer .btn-link {
  background: transparent;
  border: none;
  color: #9ca3af;
  padding-left: 0;
}

.devis-success-footer .btn[disabled] {
  opacity: 0.4;
  cursor: default;
}




/* ********* TVA ********** */

.tva-breakdown {
  margin: 6px 10px;
  font-size: 0.9em;
  color: var(--muted);
}
.tva-breakdown .tva-line {
  display: flex;
  justify-content: space-between;
  padding: 2px 0;
}
.tva-breakdown .tva-line span {
  color: var(--muted);
}
.btn-tva.disabled-tva {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}


.btn-tva.tva-disabled,
.tva-picker.tva-disabled .btn-tva {
  opacity: 0.5;
  cursor: not-allowed;
}
.tva-picker.tva-disabled .tva-popover button[disabled] {
  cursor: not-allowed;
}


.tva-notice {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    border-left: 2px solid var(--accent);
    padding: 10px 12px;
    margin: 6px 0 0;
    font-size: 0.8em;
    color: var(--muted);
    line-height: 1.3;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity .3s ease, transform .3s ease;
}

.tva-notice.visible {
  display: flex;
  opacity: 1;
  transform: translateY(0);
}
.tva-notice .lucide {
  color: var(--accent);
  margin-top: 3px;
}
.pdf-frame-wrapper {
  background: #fff;
  padding: 12px;
  border-radius: 10px;
  box-shadow: var(--shadow-soft, 0 2px 8px rgba(0,0,0,0.15));
}

.pdf-frame-wrapper iframe {
  display: block;
  width: 100%;
  height: 750px;
  background: #fff; /* au cas où */
  border-radius: 6px;
  border: none;
}

.pdfjs-blueviewer .pdfjs-loader {
  text-align: center;
  padding: 16px;
  color: var(--muted);
  font-size: 14px;
}

.pdfjs-progress {
  height: 4px;
  width: 100%;
  background: #e0e0e0;
  margin-top: 4px;
  overflow: hidden;
}
.pdfjs-progress .bar {
  height: 100%;
  background: var(--accent);
  width: 0%;
  transition: width 0.2s linear;
}

.spin {
  display: inline-block;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

















/* ----------------------------- */
/* 🎛️ BARRE D’OUTILS DEVIS */
/* ----------------------------- */

.dv-apercu-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
 
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
}

/* ---- Partie gauche ---- */
.btn-split .btn-left {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  background: var(--success) !important;
  color: var(--textNeg) !important;
  border: none !important;
  padding: 12px 16px 10px 16px;
  font-weight: 500 !important;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-split .btn-left .lucide {
  width: 16px;
  height: 16px;

}


/* ---- Partie droite ---- */
.btn-split .btn-right {
  background: var(--success) 100% !important;
  border: none !important;
  padding: 0 10px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--textNeg) !important;
  transition: all 0.2s;
}
.btn-split .btn-right .lucide {
  height: 16px;
  width: 16px;

}


.btn-split .btn-right:hover,
.btn-split .btn-left:hover {
     filter: brightness(1.05);

}



/* ---- Menu déroulant ---- */
.btn-split .menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--panel);
 
  z-index: 100;
  transform: translateY(4px);
}

.btn-split .btn-right {
   border-radius: 0 0px 6px 0;
}
.btn-split .btn-left {
   border-radius: 0px 0 0 6px;
}


.btn-split.open .menu {
  display: block;
  animation: fadeInMenu 0.15s ease forwards;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--muted);
  text-align: left;
  transition: all 0.2s ease;
}
.menu-item .lucide { 
  width: 16px;
  height: 16px;
}
.menu-item:hover {
  background: color-mix(in srgb, var(--accent) 10%, var(--panel));
}

/* ---- Variante rouge (refusé) ---- */
.btn-split[data-current="refuser"] .btn-left,
.btn-split[data-current="refuser"] .btn-right {
  background: var(--warning);
}
.btn-split[data-current="refuser"] .btn-left:hover {
  background: color-mix(in srgb, var(--warning) 85%, white);
}
.btn-split[data-current="refuser"] .btn-right:hover {
  background: color-mix(in srgb, var(--warning) 75%, white);
}
/* ---- Variante rouge (envoyer) ---- */
.btn-split[data-current="envoyer"] .btn-left,
.btn-split[data-current="envoyer"] .btn-right {
  background: var(--accent);
}
.btn-split[data-current="envoyer"] .btn-left:hover {
  background: color-mix(in srgb, var(--accent) 85%, white);
}
.btn-split[data-current="envoyer"] .btn-right:hover {
  background: color-mix(in srgb, var(--accent) 75%, white);
}
/* ============================ */
/* 🎛️ Split-button Statut       */
/* ============================ */

.btn-split {
  position: relative;
  display: inline-flex;
  border-radius: var(--radius);
  /* ⚠️ ne surtout pas couper le menu */
  overflow: visible;              /* ← était hidden : à corriger */
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ... tes styles btn-left / btn-right inchangés ... */

.btn-split .menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transform: translateY(4px);
  z-index: 9999;                  /* ← s’assurer qu’il passe devant */
}

.btn-split.open .menu {
  display: block;
  animation: fadeInMenu 0.15s ease forwards;
}
.btn-split .btn-right {
  background: color-mix(in srgb, var(--success) 80%, transparent);
  border: none;
  padding: 6px 14px; /* ← élargi pour clic facile */
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px; /* ← assure une zone visible */
  cursor: pointer;
  color: #fff;
  transition: background 0.2s ease;
  user-select: none;
}

.btn-split .btn-right .lucide {
  pointer-events: none; /* ← évite de bloquer le clic sur l'icône */
}


/* ==========================================================================
   🎨 APERCU DEVIS — STYLE RESPONSI F
   ========================================================================== */

/* ---------- VARIABLES GLOBALES ---------- */
.dv-preview {
  --dv-bg: #fff;
  --dv-text: #111;
  --muted: #666;
  --dv-border: #ddd;
  --dv-radius: 14px;
  --dv-shadow: 0 3px 10px rgba(0,0,0,0.08);


  background: white;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;

  box-shadow: var(--shadow-pop);
}

/* ---------- TITRES DE CARTES ---------- */
.dv-preview .card-title {
  font-size: 0.9rem;
  margin-bottom: .8rem;
  color: rgb(52, 105, 173);

;
}
.dv-preview .card-title.nomEntreprise {
  text-transform: uppercase;
}


/* ---------- COMPONENT : CARD ---------- */

.dv-preview .stack > * {
    margin-bottom: .3rem;
    color: #667085;

;
    font-size: 0.8rem;
}
.dv-preview .stack > *:last-child {
  margin-bottom: 0;
}


/* ==========================================================================
   📌 HEADER DEVIS
   ========================================================================== */

.dv-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 2rem;
  gap: 1rem;
}


.dv-head-left  {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:var(--document);
    margin-top: 41px;
}

.dv-head-left  img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    margin-top: 1px;
}



.dv-head-right div.blocNumTopRightDevis {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    border: 1px solid var(--border);
    padding: 10px 20px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.dv-head-right h3 {
  letter-spacing: 0.2rem;
  font-size: 1.3rem;
  color: var(--document);
}


.dv-head-right .kv{
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.dv-head-right .kv span {
  color: #667085;

;
  font-size: .8rem;
}
.dv-head-right .kv strong {
  font-size: 0.8rem;
  color: #667085;
}

/* MOBILE */
@media (max-width: 650px) {
  .dv-head {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .dv-head-left .brand-logo {
    width: 150px;
  }
}
.blocClientDevis {
  padding: 20px;
  background-color: #f7f8fa;  
}


.header-content {
  margin-bottom: 2rem;

  font-size: .8rem;
  color: #667085;
}


/* ==========================================================================
   📌 INFOS PARTIES (ARTISTE / CLIENT)
   ========================================================================== */

.dv-parties {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
  margin-bottom: 2rem;
}

@media (max-width: 820px) {
  .dv-parties {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   📌 CHIPS TVA
   ========================================================================== */

.dv-tva-resume {
  margin-bottom: 0.5rem;
}

.dv-tva-text,
.dv-pay {
  font-size: 0.8rem;
  color: #667085;
    background: #f7f8fa;
    padding: 1rem;
}
.dv-totaux {
  font-size: .8rem;
  color: #667085;
;
}
/* ==========================================================================
   📌 TABLEAU PRESTATIONS
   ========================================================================== */

.dv-prestas {
  margin-bottom: 2rem;
}

/* Scroll horizontal mobile */
.dv-prestas table {
  width: 100%;
  border-collapse: collapse;
}

.dv-prestas {
  overflow-x: auto;
}

.table-prestas th,
.table-prestas td {
  padding: .5rem .5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: .8rem;
  color: #667085;
}

.table-prestas th {
  background: rgb(52, 105, 173);
  font-weight: 600;
  color: white;
}


/* Colonnes étroites */
.table-prestas .c-qte,
.table-prestas .c-unit,
.table-prestas .c-pu,
.table-prestas .c-tva,
.table-prestas .c-ht {
  white-space: nowrap;
}

/* Groupes */
.row-group {
  background: #f7f8fa;
}


/* Texte simple */
.row-text .text-block {

}

/* Ligne prestation */
.row-line td {
  padding-top: .8rem;
  padding-bottom: .8rem;
}

.table-prestas p, .dv-cgv p {
    display: block;
    margin-block-start: 0em;
    margin-block-end: 0em;
    margin-inline-start: 0px;
    margin-inline-end: 0px;
    unicode-bidi: isolate;


}

.c-ht {

  text-align: end !important;
}
/* ==========================================================================
   📌 TOTALS
   ========================================================================== */

.dv-totaux {
  margin-bottom: 2rem;
}

.dv-totaux .kv {
  margin: .35rem 0;
  display: flex;
  justify-content: space-between;

}

.dv-totaux .kv span {



}

.dv-totaux .total strong {
  font-size: 1rem;

;
}

.dv-pay-tot.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 30px;
}

.dv-pay .kv,
.dv-tot .kv {
  margin: 6px 0;
}

.dv-pay .card-title,
.dv-tot .card-title {
  margin-bottom: 10px;
}



@media (max-width: 700px) {
  .dv-pay-tot.grid-2 {
    grid-template-columns: 1fr;
  }
}


/* ==========================================================================
   📌 ACOMPTE & CGV
   ========================================================================== */

.dv-bottom {
  margin-bottom: 3rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.3rem;
}

@media (max-width: 820px) {
  .grid-2 {
    grid-template-columns: 1fr;
  }
}

.cgv-content {

  font-size: .8rem;
  color: #667085;

}
.dv-cgv {
  margin-top: 2rem;
}

/* ==========================================================================
   📌 ELEMENTS VIDES
   ========================================================================== */

.dv-prestas .empty {
  padding: 1.2rem;
  text-align: center;


;
  font-style: italic;
}


.table-prestas {
  table-layout: fixed;
  width: 100%;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */


.dv-footer {
  margin-top: 60px;
  padding: 20px 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 30px;

  font-size: .8rem;
  color: #667085;

}

.dv-footer .footer-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dv-footer .footer-title {
  font-weight: 600;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 12px;
}

.dv-footer .right div strong {
  font-weight: 600;
}

/* Responsive */
@media (max-width: 800px) {
  .dv-footer {
    grid-template-columns: 1fr;
    text-align: left;
    gap: 15px;
  }
}









/* --- 📦 Card/Bloc Gmail --- */

.big-block {
  padding: 20px;
  background: var(--bg);
}

/* --- Destinataires --- */
.recipients-wrap .recipient-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.recipients-wrap input {
  flex: 1;
}

.recipient-row .btn-remove-recipient {
  opacity: 0.6;
}
.recipient-row .btn-remove-recipient:hover {
  opacity: 1;
}

/* --- Toggle ENVOI / RELANCE --- */
.toggle-wrap {
  width: 100%;
  max-width: 145px;
  cursor: pointer;
}

.toggle-slider {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 32px;
  height: 40px;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.toggle-label {
  flex: 1;

  color: var(--text);
  z-index: 2;
 
  transition: 0.25s;
  justify-content: center;
}

.toggle-wrap[data-mode="envoi"] .toggle-label.envoi,
.toggle-wrap[data-mode="relance"] .toggle-label.relance {
  opacity: 1;
  color: var(--textNeg);
}

.toggle-knob {
  position: absolute;
  left: 4px;
  width: calc(50% - 6px);
  height: 32px;
  border-radius: 20px;
  background: var(--accent);
  transition: transform 0.25s ease;
}

.toggle-wrap[data-mode="relance"] .toggle-knob {
  transform: translateX(100%);
}

/* --- Gmail-like label spacing --- */
.email-block.card .field .lbl {
  font-weight: 600;
  display: block;
  margin-bottom: 6px;
}

/* --- Documents joints --- */
.docs-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.docs-list .doc-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
}



.ql-toolbar.ql-snow + .ql-container.ql-snow {
    border-top: 0 !important;
    background: var(--panel) !important;
    border-radius: 10px 10px 0 0;
}

.ql-container.ql-snow {
     border: 0 !important; 
}
.ql-toolbar.ql-snow {
    border: 1px solid var(--border) !important;
    background: var(--bg) !important;

}
.ql-editor {
    padding: 16px !important;
    tab-size: 8 !important;
    font-size: 0.9rem !important;
    line-height: 1.4rem !important;
    color: var(--text) !important;
    background: var(--panel) !important;

}
.ql-snow .ql-stroke,
.ql-snow .ql-picker,
.ql-snow .ql-picker.ql-expanded .ql-picker-label { 
    stroke: var(--accent) !important;
    color: var(--accent) !important;
}
.ql-snow .ql-fill, .ql-snow .ql-stroke.ql-fill {
    fill:  var(--accent) !important;
}
.gMailEditor {
  background: var(--panel);


}
.signature-preview {
  padding: 16px;
}


 .lbl.lblSmall {

    font-size: 0.8rem !important;
}


#mailSubject, #dmMailSubject {
  font-size: 1.1rem;
  border: 0 !important;
}

#mailSubject:hover, #dmMailSubject:hover {
  border: 0 !important;
  background: var(--hover, color-mix(in srgb, var(--accent) 12%, transparent));
}

.preview-link {
  text-align: center;


}

.doc-item .lucide {
  color: var(--accent);
  width: 20px;
  height: 20px;
}



/* Cache totalement la toolbar */
.dv-apercu-toolbar.toolbar-hidden {
  display: none;
}

/* Croix retour */
.dv-back-to-apercu {
    position: absolute;
    top: 10px;
    right: 20px;
    background: none;
    border: none;
    padding: 9px 18px;
    cursor: pointer;
    z-index: 999;
    background: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--textNeg);
    border-radius: 6px;
}

.dv-back-to-apercu .lucide {
  width: 20px;
  height: 20px;
}



/* **************************************************
   TIMELINE HARD DÉCO — Édition Premium
   Horizontale, compacte, icônes, couleurs, animations
   ***************************************************/

.timeline-hd {
  position: relative;
  display: block;
  padding: 12px 0;
  margin-bottom: 10px;
  overflow-x: auto;
  white-space: nowrap;
}

/* Scroll bar fine */
.timeline-hd::-webkit-scrollbar {
  height: 6px;
}
.timeline-hd::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 3px;
}

/* Barre principale */
.timeline-hd-events {
 display: inline-flex; /* au lieu de flex */
  gap: 48px;
  position: relative;
  z-index: 2;
  padding: 0 6px;
}

/* Barre qui ne dépasse pas */
.timeline-hd-events::before {
    content: "";
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent);
    left: 0px;
    right: 55px;
    z-index: -1;
    opacity: 0.3;
}

/* Wrapper des events */
.timeline-hd-events {
  display: inline-flex;
  gap: 48px;
  position: relative;
  z-index: 2;
  padding: 0 6px;
}

/* Un event */
.thd-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 70px;
}

/* Icône au dessus */
.thd-icon {
  margin-bottom: 4px;
    background: var(--accent);
    color: var(--panel);
    border-radius: 999px;
    height: 30px;
    width: 30px;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;

}
.thd-icon .lucide {
  width: 20px;
  height: 20px;
}



/* Labels */
.thd-labels {
  text-align: center;
  font-size: 0.75rem;
  line-height: 1.1;
}

.thd-type {
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
}

.thd-date {
  color: var(--muted);
  font-size: 0.7rem;
}

/* Couleurs par type */
/*
.thd-item[data-type="création"]      .thd-dot { --accent: var(--gray); }
.thd-item[data-type="finalisation"]  .thd-dot { --accent: var(--blue); }
.thd-item[data-type="envoi"]         .thd-dot { --accent: var(--purple); }
.thd-item[data-type="validation"]    .thd-dot { --accent: var(--green); }
.thd-item[data-type="annulation"]    .thd-dot { --accent: var(--red); }
.thd-item[data-type="archive"]       .thd-dot { --accent: var(--muted); }
*/




/* ========== BLOC ÉTAT DU DEVIS ========== */

#historiqueDevis {
  border: 1px solid var(--border);
  padding: 16px;
  border-radius: var(--radius);
  display: flex;
  flex: 1;
  gap: 40px;
  margin-bottom: 16px;
}

.dv-etat {
  margin-bottom: 16px;
}

.dv-etat-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
  color: var(--text);
}

.dv-etat-header .lucide {
  width: 22px;
  height: 22px;
  color: var(--accent);
}

.dv-etat-label {
  font-size: 1rem;
  font-weight: 600;
}

.dv-etat-date,
.dv-step-date {
  font-size: 0.75rem;
  color: var(--muted);
}

.dv-etat-desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
 padding-left: 33px;
}


/* ========== PROGRESSION ========== */
.dv-etat-progress {
  margin-top: 10px;
}

.dv-progress-track {
  display: flex;
  gap: 36px;
  align-items: center;
  padding: 6px 4px;
}

.dv-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.dv-step-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--border);
  border: 2px solid var(--panel);
}

.dv-step.active .dv-step-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent);
}

.dv-step-label {
  font-size: 0.7rem;
  margin-top: 4px;
}

/* Ligne de connexion entre les steps */
.dv-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 6px;
  left: 100%;
  width: 36px;
  height: 2px;
  background: var(--border);
}

.dv-step.active:not(:last-child)::after {
  background: var(--accent);
}





.headerDocumentModal {
  display: flex;
  gap: 16px;
  margin-bottom: 30px;
}
#projetLie {
  flex: 1;
  margin-bottom: 16px;
}

#headerApercu {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

.dv-projet-lie {
  background: var(--panel);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  position: relative;
}

.dv-projet-header {
  display: flex;
  gap: 10px;
  margin-bottom: 19px;
  align-items: center;
}

.dv-projet-header .lucide {
  width: 22px;
  height: 22px;
  color: var(--accent);
}


.dv-projet-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.dv-projet-info {
  margin-bottom: 4px;
  font-size: 0.75rem;
  color: var(--muted)
}

.dv-projet-open {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: absolute;
  bottom: 16px;
  right: 16px;
}


/* Responsive */
@media (max-width: 1000px) {
  .headerDocumentModal {
    flex-direction: column;
    gap: 0;
    margin-bottom: 40px;
  }

  #historiqueDevis {
    display: block;
}


.dv-head-right h3 {
    display: flow;
}

}




