/* Hoja de factura con la plantilla de Nikony (A4). Se usa en la vista previa y en factura.html */
.nk-invoice { --nk-orange: #ff8a1f; --nk-ink: #1f2937; --nk-gray: #6b7280; --nk-line: #e5e7eb;
  font-family: Arial, 'Helvetica Neue', Helvetica, sans-serif; color: var(--nk-ink); background: #fff;
  width: 210mm; min-height: 297mm; padding: 16mm 17mm 22mm; box-sizing: border-box; position: relative; font-size: 12.5px; line-height: 1.35; }
.nk-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 14px; }
.nk-logo img { height: 72px; width: auto; display: block; margin: -8px 0 -8px -10px; }
.nk-wordmark { font: 900 34px/1 Arial, sans-serif; letter-spacing: -1px; color: #111; }
.nk-wordmark b { color: var(--nk-orange); }
.nk-title { text-align: right; }
.nk-word { color: var(--nk-orange); font-weight: 700; font-size: 29px; letter-spacing: .3px; }
.nk-num { color: var(--nk-gray); font-size: 14px; margin-top: 6px; }
.nk-from { color: var(--nk-gray); font-size: 12.5px; line-height: 1.3; margin-bottom: 26px; }
.nk-from-name { color: var(--nk-ink); font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.nk-box { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; border: 1px solid #d1d5db; border-radius: 6px; background: #f9fafb; padding: 13px 18px 12px; margin-bottom: 34px; }
.nk-label { font-size: 10.5px; font-weight: 700; color: var(--nk-gray); letter-spacing: .4px; margin-bottom: 6px; }
.nk-to { font-size: 13.5px; line-height: 1.35; }
.nk-meta { display: grid; grid-template-columns: auto 1fr; gap: 6px 52px; margin: 6px 0 0; align-content: start; font-size: 13px; }
.nk-meta dt { color: var(--nk-gray); }
.nk-meta dd { margin: 0; }
.nk-table { width: 100%; border-collapse: collapse; margin-bottom: 18px; }
.nk-table th { background: #111827; color: #fff; font-weight: 700; font-size: 12.5px; padding: 7px 9px; text-align: center; }
.nk-table td { padding: 8px 9px 10px; font-size: 12.5px; vertical-align: top; border-bottom: 1px solid #f0f1f3; text-align: center; }
.nk-table .c-desc { text-align: left; width: 48%; }
.nk-table th.c-price, .nk-table td.c-price, .nk-table th.c-amount, .nk-table td.c-amount { text-align: right; white-space: nowrap; }
.nk-totals { margin-left: auto; width: 370px; font-size: 13.5px; }
.nk-row { display: flex; justify-content: space-between; padding: 4px 0; }
.nk-row span:first-child { color: var(--nk-gray); flex: 1; text-align: right; padding-right: 64px; }
.nk-total { display: flex; justify-content: space-between; background: var(--nk-orange); border-radius: 4px; padding: 9px 0; margin-top: 12px; font-weight: 700; font-size: 17px; }
.nk-total span:first-child { flex: 1; text-align: right; padding-right: 64px; }
.nk-total span:last-child { padding-right: 2px; }
.nk-pay { margin-top: 28px; font-size: 12.5px; line-height: 1.35; }
.nk-notes { margin-top: 8px; color: var(--nk-gray); }
.nk-legal { margin-top: 8px; font-size: 11px; color: var(--nk-gray); }
.nk-foot { position: absolute; left: 17mm; right: 17mm; bottom: 12mm; border-top: 1px solid var(--nk-line); padding-top: 9px; text-align: center; color: var(--nk-gray); font-size: 11px; }

/* Vista previa dentro del panel: la hoja se escala para caber en el modal */
.nk-preview { background: #e9e5dc; border-radius: 12px; padding: 14px; overflow: auto; }
.nk-scale { margin: 0 auto; overflow: hidden; }
.nk-preview .nk-invoice { box-shadow: 0 2px 12px rgba(0, 0, 0, .12); margin: 0; transform-origin: top left; }

@page { size: A4; margin: 0; }
@media print {
  .nk-preview { background: none; padding: 0; }
  .nk-preview .nk-invoice { box-shadow: none; transform: none !important; }
}
