/* =========================================================================
   Lumisphere ERP — Styles "Édition Devis"
   ========================================================================= */

/* En-tête du panel d'édition */
.dve-header-row {
  display: flex; justify-content: space-between; align-items: center;
}
.dve-num {
  font-family: 'Oswald', sans-serif;
  font-size: 22px; font-weight: 700; letter-spacing: 2px;
  color: var(--gold-light);
}
.dve-meta { font-size: 12px; color: var(--text-dim); margin-top: 4px; }
.dve-status-wrap { display: flex; align-items: center; gap: 10px; }
.dve-sync {
  font-size: 18px;
  color: #22c55e;
}
.dve-sync-pending { color: #f59e0b; animation: dvlPulse 1.2s infinite; }
.dve-sync-failed  { color: #ef4444; }

/* Lecture seule (champs non éditables) */
.dve-readonly {
  padding: 8px 12px; background: rgba(0,0,0,0.2);
  border-radius: 6px; border: 1px solid rgba(255,255,255,0.05);
  font-size: 13px; color: var(--text);
}
.dve-label {
  display: block; font-size: 11px; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 4px;
}

/* Recherche produit (pour ajouter une ligne) */
.dve-add-product {
  padding: 14px; background: rgba(245,158,11,0.05);
  border: 1px dashed rgba(245,158,11,0.3); border-radius: 8px;
  margin-bottom: 12px;
}
.dve-add-product input {
  width: 100%; padding: 8px 12px; font-size: 14px;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(245,158,11,0.2);
  border-radius: 6px; color: var(--text);
}
.dve-product-results {
  margin-top: 8px; max-height: 250px; overflow-y: auto;
}
.dve-product-result {
  padding: 8px 10px; border-radius: 6px; cursor: pointer;
  font-size: 13px; transition: background 0.1s;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.dve-product-result:hover { background: rgba(245,158,11,0.1); }
.dve-product-result:last-child { border-bottom: none; }

/* Lignes */
.dve-lines { display: flex; flex-direction: column; gap: 8px; }
.dve-line {
  display: grid;
  grid-template-columns: 30px 50px 1fr auto 110px 30px;
  gap: 10px; align-items: center;
  padding: 10px 12px; background: rgba(255,255,255,0.02);
  border-radius: 8px; border: 1px solid rgba(255,255,255,0.05);
}
.dve-line:hover { background: rgba(255,255,255,0.04); }
.dve-line-num {
  font-weight: 700; color: var(--gold-light);
  font-family: 'Oswald', sans-serif; font-size: 14px;
  text-align: center;
}
.dve-line-photo img {
  width: 44px; height: 44px; object-fit: contain;
  background: #fff; border-radius: 4px;
}
.dve-no-photo {
  width: 44px; height: 44px; display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.05); border-radius: 4px; font-size: 18px; opacity: 0.4;
}
.dve-line-info { min-width: 0; }
.dve-line-code {
  font-family: monospace; font-size: 11px; color: var(--gold-light);
  background: rgba(245,158,11,0.1); padding: 2px 6px;
  border-radius: 3px; display: inline-block; margin-bottom: 4px;
}
.dve-line-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dve-line-marque { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.dve-line-inputs { display: flex; gap: 8px; }
.dve-line-inputs label {
  display: flex; flex-direction: column; font-size: 10px;
  color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px;
}
.dve-line-inputs input {
  width: 80px; padding: 5px 8px; font-size: 13px;
  background: rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1);
  border-radius: 4px; color: var(--text); text-align: right;
}
.dve-line-inputs input:focus { border-color: var(--gold-light); outline: none; }

.dve-line-sub {
  font-weight: 700; color: var(--gold-light);
  text-align: right; white-space: nowrap;
  font-size: 14px;
}
.dve-line-del {
  width: 30px; height: 30px;
  background: transparent; color: var(--text-dim);
  border: 1px solid rgba(239,68,68,0.3); border-radius: 6px;
  cursor: pointer; font-size: 13px;
  transition: all 0.15s;
}
.dve-line-del:hover { background: rgba(239,68,68,0.2); color: #fca5a5; }

/* Totaux */
.dve-totals {
  margin-top: 12px; padding: 12px; background: rgba(0,0,0,0.2);
  border-radius: 6px;
}
.dve-total-row {
  display: flex; justify-content: space-between;
  padding: 5px 0; font-size: 13px;
}
.dve-total-row span:first-child { color: var(--text-dim); }
.dve-total-row span:last-child  { font-weight: 600; }
.dve-grand {
  border-top: 2px solid var(--gold-light);
  margin-top: 8px; padding-top: 10px;
  font-size: 16px;
}
.dve-grand span { color: var(--gold-light) !important; font-weight: 700 !important; }

/* Barre d'actions */
.dve-actions-bar {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 20px; padding: 16px;
  background: rgba(0,0,0,0.3); border-radius: 10px;
  border: 1px solid rgba(245,158,11,0.15);
  position: sticky; bottom: 12px; z-index: 10;
}
.dve-actions-bar .btn { font-size: 13px; padding: 8px 16px; }
.btn.dve-dirty {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  animation: dvePulse 1.5s ease-in-out infinite;
}
@keyframes dvePulse {
  0%,100% { box-shadow: 0 0 0 rgba(245,158,11,0.5); }
  50%     { box-shadow: 0 0 16px rgba(245,158,11,0.7); }
}
