/* Ajustes que Tailwind no cubre de forma directa */
html { -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
.tabular-nums { font-variant-numeric: tabular-nums; }
.no-scrollbar { scrollbar-width: none; }
.no-scrollbar::-webkit-scrollbar { display: none; }
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

@keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.sheet-in { animation: sheet-in .22s ease-out; }
.fade-in { animation: fade-in .2s ease-out; }
.toast { transition: opacity .3s; animation: fade-in .2s ease-out; }

input[type="date"], input[type="time"], input[type="week"] { min-height: 2.75rem; }

/* ---------- Documentos imprimibles (A4 / ticket 80 mm) ---------- */
#print-root { display: none; }
.doc { color: #1c1917; background: #fff; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.doc-render { position: fixed; left: -10000px; top: 0; }
.doc-a4 { font-family: Inter, system-ui, sans-serif; font-size: 10.5pt; line-height: 1.4; }
.doc-a4.doc-render { width: 186mm; }
.doc-page + .doc-page { page-break-before: always; break-before: page; }
.doc .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.doc .r { text-align: right; } .doc .c { text-align: center; } .doc .nw { white-space: nowrap; }
.doc-muted { color: #57534e; font-size: 9pt; }
.doc-strong { font-weight: 600; }
.doc-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 10px; border-bottom: 2.5px solid #1c1917; margin-bottom: 14px; }
.doc-head-right { text-align: right; font-size: 9.5pt; }
.doc-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.doc-logo { height: 18mm; max-width: 40mm; object-fit: contain; flex-shrink: 0; }
.ticket .t-logo { display: block; max-height: 22mm; max-width: 60%; margin: 0 auto 4px; object-fit: contain; }
.doc-brand { font-family: 'Playfair Display', Georgia, serif; font-size: 20pt; font-weight: 600; line-height: 1.1; }
.doc-title { font-size: 12.5pt; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.doc-section { margin-top: 14px; }
.doc-section h3 { font-size: 9pt; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #44403c; margin: 0 0 6px; padding-bottom: 3px; border-bottom: 1px solid #d6d3d1; }
.doc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.doc-info { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; border: 1px solid #d6d3d1; border-radius: 6px; padding: 8px 10px; }
.doc-info div > span { display: block; font-size: 8pt; text-transform: uppercase; letter-spacing: .06em; color: #78716c; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 9.5pt; }
.doc-table th { background: #292524; color: #fff; font-weight: 600; font-size: 8.5pt; text-transform: uppercase; letter-spacing: .04em; text-align: left; padding: 5px 7px; }
.doc-table td { padding: 5px 7px; border-bottom: 1px solid #e7e5e4; vertical-align: top; }
.doc-table tbody tr:nth-child(even) td { background: #f5f5f4; }
.doc-table tfoot td { font-weight: 700; border-top: 2px solid #1c1917; border-bottom: 0; background: #fff; }
.doc-table tr { page-break-inside: avoid; break-inside: avoid; }
.doc-kv { width: 100%; border-collapse: collapse; font-size: 10pt; }
.doc-kv td { padding: 4px 0; border-bottom: 1px dotted #d6d3d1; }
.doc-kv tr.strong td { font-weight: 700; border-top: 1.5px solid #1c1917; border-bottom: 0; padding-top: 6px; }
.doc-kv tr.neg td:last-child { color: #be123c; } .doc-kv tr.pos td:last-child { color: #b45309; } .doc-kv tr.ok td:last-child { color: #047857; }
.doc-total { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; padding: 10px 14px; border: 2px solid #1c1917; border-radius: 6px; font-size: 13pt; font-weight: 700; }
.doc-note { margin-top: 10px; padding: 8px 10px; border-left: 3px solid #a8a29e; background: #fafaf9; font-size: 9.5pt; }
.doc-signs { display: flex; gap: 40px; margin-top: 46px; page-break-inside: avoid; break-inside: avoid; }
.doc-sign { flex: 1; text-align: center; font-size: 9.5pt; }
.doc-sign-line { border-top: 1px solid #1c1917; margin-bottom: 4px; }
.doc-foot { margin-top: 22px; padding-top: 6px; border-top: 1px solid #d6d3d1; font-size: 8pt; color: #78716c; text-align: center; }

/* Ticket 80 mm (también es la vista previa dentro de los modales) */
.ticket { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; line-height: 1.35; color: #1c1917; }
.ticket .t-row { display: flex; justify-content: space-between; gap: 8px; }
.ticket .t-row > span:last-child { text-align: right; white-space: nowrap; }
.ticket hr { border: 0; border-top: 1px dashed #78716c; margin: 6px 0; }
.ticket .t-big { font-size: 14px; font-weight: 700; }
.ticket .t-box { border: 1px solid #1c1917; padding: 4px 6px; margin: 6px 0; text-align: center; font-weight: 700; }
.doc-ticket.doc-render { width: 72mm; }

@media print {
  body.printing > *:not(#print-root) { display: none !important; }
  body.printing #print-root { display: block; }
  body.printing #print-root .doc-ticket { width: 72mm; }
  body.printing { background: #fff !important; }
}
