/* ═══════════════════════════════════════════
   NOTAS DE REMISIÓN (modal de emisión)
   La vista imprimible se genera en ventana aparte.
   ═══════════════════════════════════════════ */

/* Botón "Nota" en las filas de retiro del historial */
.btn-nota {
  background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #bfdbfe;
  margin-right: 6px;
}
.btn-nota:hover { background: var(--brand); color: #fff; }

/* Dos acciones por fila -> algo más de ancho */
.history-table .w-action, .history-table .cell-action { width: 158px; }

/* Línea de origen dentro del modal */
.nota-line-preview {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 16px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r);
  font-size: .92rem; color: var(--ink);
}

/* Segmentado con/sin factura */
.segmented { display: inline-flex; gap: 6px; padding: 4px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); }
.seg-btn {
  border: none; background: transparent; cursor: pointer; font-family: var(--font-body);
  padding: 8px 16px; border-radius: var(--r-sm); font-weight: 700; font-size: .88rem; color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.seg-btn.on { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); }

/* Confirmación post-emisión */
.nota-ok { text-align: center; padding: 10px 0; }
.nota-ok p { margin: 2px 0; font-weight: 700; color: var(--ink); }
.nota-ok .nota-ok-sub { font-weight: 500; color: var(--ink-soft); font-size: .9rem; }

/* ── Modal ancho con formulario + preview en vivo ── */
.modal-card.nota-modal-wide { width: min(920px, calc(96vw / var(--z))); max-height: calc(92vh / var(--z)); display: flex; flex-direction: column; }
.modal-card.nota-modal-wide .modal-body { overflow-y: auto; }
.nota-split { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
.nota-form-col { display: grid; gap: 14px; align-content: start; min-width: 0; }
.nota-form-col .nota-line-preview { margin-bottom: 0; }
.nota-preview-col { display: flex; flex-direction: column; gap: 7px; min-width: 0; position: sticky; top: 0; }
.nota-preview-hint { font-size: 11px; color: var(--ink-faint); text-align: center; }

/* ── Preview del nota (réplica fluida del imprimible) ── */
.nota-preview {
  background: #fff; color: #2b3a9b; border: 1px solid var(--line); border-radius: var(--r);
  padding: 16px 18px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;
  box-shadow: var(--shadow-sm); overflow: hidden;
}
.np-fill { font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: #1c3fae; }

.np-top { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.np-logo { width: 56px; height: auto; display: block; }
.np-comp { text-align: center; }
.np-ln { font-size: 7.5px; font-weight: 700; letter-spacing: .4px; line-height: 1.35; }

.np-mid { display: flex; justify-content: flex-end; align-items: flex-end; gap: 12px; margin-top: 8px; }
.np-fecha { font-size: 9px; font-weight: 800; white-space: nowrap; }
.np-fecha .np-fill { display: inline-block; min-width: 18px; text-align: center; border-bottom: 1px solid #2b3a9b; padding: 0 4px; font-size: 11px; }

.np-folio { display: flex; justify-content: flex-end; align-items: center; gap: 14px; margin: 6px 0 3px; }
.np-folio-num { color: #d63a2e; font-weight: 800; font-size: 13px; letter-spacing: 2px; }
.np-factnum { font-size: 10px; font-weight: 800; letter-spacing: .8px; }
.np-fmark { font-size: 24px; font-weight: 900; line-height: 1; }

.np-prov { font-size: 8px; font-weight: 800; letter-spacing: .3px; margin: 4px 0 6px; }

.np-box { border: 1.6px solid #2b3a9b; border-radius: 13px; padding: 4px 13px 9px; }
.np-line {
  border-bottom: 1px solid #2b3a9b; min-height: 21px;
  display: flex; align-items: flex-end; padding: 0 3px 2px;
  font-family: 'Segoe Print', 'Bradley Hand', 'Comic Sans MS', cursive; color: #1c3fae; font-size: 10px;
  white-space: nowrap; overflow: hidden;
}
.np-line:last-child { border-bottom: none; }

.np-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-top: 16px; }
.np-recibi { width: 44%; text-align: center; }
.np-sig { height: 28px; border-bottom: 1.6px solid #2b3a9b; }
.np-recibi-lbl { font-weight: 800; letter-spacing: 3px; font-size: 9px; margin-top: 4px; }
.np-vend { width: 52%; font-size: 9px; font-weight: 800; }
.np-vend-row { display: flex; align-items: flex-end; gap: 6px; margin-bottom: 11px; white-space: nowrap; }
.np-vend-row .np-grow { flex: 1; border-bottom: 1px solid #2b3a9b; padding: 0 4px; min-height: 14px; font-size: 11px; overflow: hidden; text-overflow: ellipsis; }

@media (max-width: 760px) {
  .modal-card.nota-modal-wide { width: calc(96vw / var(--z)); }
  .nota-split { grid-template-columns: 1fr; gap: 18px; }
  .nota-preview-col { position: static; }
}
