/* ════ "+ NUEVO PRESUPUESTO" (Fase CA3b) ════ */
.new-budget-row { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.btn-new-budget { background: none; border: 1px dashed var(--border2); color: var(--muted); padding: 8px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-family: var(--font-d); letter-spacing: 1px; display: flex; align-items: center; gap: 6px; transition: all .2s; }
.btn-new-budget:hover { border-color: var(--brand-light); color: var(--brand-light); }
.btn-new-budget svg { width: 13px; height: 13px; }

/* ════ BANNER MODO EDICIÓN ════ */
.edit-banner { background: var(--warn-bg); border: 1px solid var(--warn-border); border-radius: 7px; padding: 12px 18px; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#edit-banner { display: none; }
.edit-banner span { font-size: 13px; color: var(--warn); }
.edit-banner span strong { font-family: var(--font-d); letter-spacing: 1px; }
.edit-banner button { background: none; border: 1px solid var(--warn-border); color: var(--warn); padding: 5px 12px; border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; font-family: var(--font-b); transition: all .2s; white-space: nowrap; }
.edit-banner button:hover { background: var(--warn-border); }

/* ════ SECCIONES TIPO CARD ════ */
.card-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; margin-bottom: 20px; }
.card-section:hover { border-color: var(--border2); }
.section-title { font-family: var(--font-d); font-size: 13px; letter-spacing: 2.5px; text-transform: uppercase; color: var(--brand-light); margin-bottom: 18px; display: flex; align-items: center; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.section-title svg { width: 16px; height: 16px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-2 + .grid-2 { margin-top: 14px; }
.pfield label { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; display: block; margin-bottom: 5px; }
.pfield input, .pfield select, .pfield textarea { width: 100%; background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 9px 12px; border-radius: var(--radius-sm); font-size: 13px; font-family: var(--font-b); outline: none; transition: border-color .2s; }
.pfield input:focus, .pfield select:focus, .pfield textarea:focus { border-color: var(--brand-light); }
.pfield select option { background: var(--surface2); }
.pfield textarea { resize: vertical; min-height: 64px; }

/* ════ AUTOCOMPLETADO DE CLIENTE (PROFESIONAL, Fase CA2) ════ */
.autocomplete-wrap { position: relative; }
.autocomplete-list { display: none; position: absolute; top: calc(100% + 4px); left: 0; right: 0; background: var(--surface2); border: 1px solid var(--border2); border-radius: var(--radius-sm); z-index: 30; max-height: 240px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.autocomplete-list.show { display: block; }
.autocomplete-item { padding: 10px 12px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--border); }
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--surface); }
.autocomplete-item .ac-nombre { color: var(--text); font-weight: 600; }
.autocomplete-item .ac-doc { color: var(--muted); font-size: 11px; margin-top: 2px; }
.autocomplete-new { padding: 10px 12px; font-size: 13px; font-weight: 600; cursor: pointer; color: var(--brand-light); border-top: 1px solid var(--border); }
.autocomplete-new:hover { background: var(--surface); }

/* ════ TABLA DE ÍTEMS ════ */
.items-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.items-table th { font-size: 10px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.items-table th:nth-child(1) { width: 30%; }
.items-table th:nth-child(2) { width: 18%; }
.items-table th:nth-child(3) { width: 8%; }
.items-table th:nth-child(4) { width: 8%; }
.items-table th:nth-child(5) { width: 12%; }
.items-table th:nth-child(6) { width: 8%; }
.items-table th:nth-child(7) { width: 12%; }
.items-table th:nth-child(8) { width: 4%; }
.items-table td { padding: 5px 6px; vertical-align: middle; }
.items-table input, .items-table select { background: var(--surface2); border: 1px solid var(--border); color: var(--text); padding: 7px 9px; border-radius: var(--radius-xs); font-size: 13px; font-family: var(--font-b); outline: none; width: 100%; transition: border-color .2s; }
.items-table input:focus, .items-table select:focus { border-color: var(--brand-light); }
.item-sub { font-weight: 600; color: var(--text-bright); font-size: 13px; text-align: right; white-space: nowrap; padding-right: 10px; }
.del-btn { background: none; border: 1px solid #3a2020; color: var(--danger); padding: 5px 8px; border-radius: var(--radius-xs); cursor: pointer; font-size: 13px; line-height: 1; transition: all .2s; }
.del-btn:hover { background: #3a2020; }
.add-item-btn { background: none; border: 1px dashed var(--border2); color: var(--muted); padding: 8px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; font-family: var(--font-b); width: 100%; margin-top: 10px; transition: all .2s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.add-item-btn:hover { border-color: var(--brand-light); color: var(--brand-light); }
.add-item-btn svg { width: 14px; height: 14px; }

/* ════ TOTALES ════ */
.totals-block { display: flex; justify-content: flex-end; gap: 32px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); align-items: flex-end; }
.total-item .tl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; }
.total-item .tv { font-family: var(--font-d); font-size: 18px; color: var(--text); margin-top: 2px; }
.total-item.grand .tv { font-size: 26px; color: var(--brand-light); }
/* #iva-block (Fase CA3) puede tener más de un par tl/tv apilado cuando
   los ítems cargados tienen distinta alícuota — separación entre grupos. */
.total-item .tv + .tl { margin-top: 8px; }

/* ════ BOTONES DE ENVÍO / GUARDADO ════ */
.send-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; align-items: center; }
.btn-wa { background: var(--green); color: #fff; border: none; padding: 12px 22px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-family: var(--font-d); letter-spacing: 1.5px; display: flex; align-items: center; gap: 8px; transition: background .2s; }
.btn-wa:hover { background: var(--green-dark); }
.btn-wa svg { width: 18px; height: 18px; }
.btn-mail { background: none; border: 1px solid var(--brand); color: var(--brand-light); padding: 12px 22px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-family: var(--font-d); letter-spacing: 1.5px; display: flex; align-items: center; gap: 8px; transition: all .2s; }
.btn-mail:hover { background: var(--brand); color: white; }
.btn-mail svg { width: 17px; height: 17px; }
.btn-pdf { background: none; border: 1px solid var(--border2); color: var(--muted); padding: 12px 22px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-family: var(--font-d); letter-spacing: 1.5px; display: flex; align-items: center; gap: 8px; transition: all .2s; }
.btn-pdf:hover { border-color: var(--text); color: var(--text); }
.btn-pdf svg { width: 17px; height: 17px; }
.btn-save { background: var(--brand); border: none; color: var(--si-gris-900); padding: 12px 22px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-family: var(--font-d); letter-spacing: 1.5px; display: flex; align-items: center; gap: 8px; transition: background .2s, box-shadow .2s; }
.btn-save:hover { background: var(--brand-light); }
.btn-save svg { width: 17px; height: 17px; }
/* Tier PROFESIONAL (Fase U4): acento ámbar puntual en el botón principal,
   sin tocar el fondo (respeta el color de marca del cliente). INICIAL no
   cambia — sigue con el celeste/color de marca de siempre. */
body.tier-profesional #btn-save { box-shadow: 0 0 0 2px var(--amber); }
.btn-cancel { background: none; border: 1px solid var(--border2); color: var(--muted); padding: 12px 22px; border-radius: var(--radius-md); cursor: pointer; font-size: 14px; font-family: var(--font-d); letter-spacing: 1.5px; display: flex; align-items: center; gap: 8px; transition: all .2s; margin-left: auto; }
.btn-cancel:hover { border-color: var(--text); color: var(--text); }
.btn-cancel svg { width: 15px; height: 15px; }

@media (max-width: 700px) {
  .grid-2 { grid-template-columns: 1fr; }
  .card-section { padding: 16px 14px; }
  /* La tabla de ítems no entra en el ancho de un celular: cada fila pasa
     a apilarse como una mini-tarjeta (sin scroll horizontal). */
  .items-table thead { display: none; }
  .items-table, .items-table tbody, .items-table tr, .items-table td { display: block; width: 100%; }
  .items-table tr { border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px; margin-bottom: 10px; }
  .items-table td { padding: 6px 2px; }
  .items-table td[data-label]::before { content: attr(data-label); display: block; font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; margin-bottom: 4px; }
  .items-table .item-sub { text-align: left; }
  .items-table .del-btn { width: 100%; padding: 8px; }
  .totals-block { flex-wrap: wrap; gap: 18px; justify-content: space-between; }
  .send-row { flex-direction: column; align-items: stretch; }
  .send-row button { justify-content: center; }
  .btn-cancel { margin-left: 0; }
}
