/* receipt_maker: rules for this tool only. Shared pieces are in ../office_tools.css.
   Read by marketing/office_tools/receipt_maker (via _head); classes start .ot-rc-.
   The print rules print only the receipt preview (.ot-rc-paper). */

/* The shared classes set display, which would beat the hidden attribute. */
.ot-rc [hidden] { display: none !important; }

/* The mock-up gives the form and the preview about the same width. */
.ot-rc .ot-rc-form { flex: 1 1 420px; gap: 16px; }
.ot-rc .ot-rc-side { flex: 999 1 420px; align-items: center; }
.ot-rc-side > .ot-label { align-self: flex-start; }

.ot-rc-balance { display: flex; align-items: center; background: var(--bg-secondary); color: var(--text); }
.ot-rc .ot-input[readonly] { background: var(--bg-secondary); }
.ot-rc .ot-input[aria-invalid="true"] { border-color: var(--danger); }
.ot-hint.ot-rc-warn { color: var(--danger); }
.ot-rc-extras > .ot-btn { flex: 0 1 auto; }

.ot-rc-item-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ot-rc-item { display: flex; gap: 8px; }
.ot-rc-item-desc { flex: 1 1 auto; min-width: 0; }
.ot-rc-item-amount { flex: 0 0 110px; }
.ot-rc-item-remove { flex: none; min-width: 44px; padding: 0 10px; font-size: 20px; }
.ot-rc-items .ot-actions-row > .ot-btn { flex: 0 1 auto; }

/* The receipt preview: same order and wording as the PDF. */
.ot-rc-paper { width: 100%; max-width: 400px; background: #fff; color: #1c1917; box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05); border-radius: 8px; padding: 26px 26px 22px; box-sizing: border-box; overflow-wrap: anywhere; }
.ot-rc-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.ot-rc-brand { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }
.ot-rc-logo { max-width: 80px; max-height: 40px; object-fit: contain; flex: none; }
.ot-rc-business { font-weight: 800; font-size: 17px; line-height: 1.25; color: #166534; }
.ot-rc-business.is-placeholder { color: #a8a29e; }
.ot-rc-contact { font-size: 12px; color: #57534e; }
.ot-rc-id { text-align: right; font-size: 13px; flex: none; max-width: 40%; }
.ot-rc-word { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; color: #57534e; }
.ot-rc-paid { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px; padding: 12px; text-align: center; margin-bottom: 12px; }
.ot-rc-paid-label { font-size: 12px; color: #166534; font-weight: 600; }
.ot-rc-paid-amount { font-size: 26px; font-weight: 800; color: #14532d; line-height: 1.2; }
.ot-rc-rows { margin: 0; }
.ot-rc-row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 5px 0; }
.ot-rc-row dt { color: #57534e; flex: none; max-width: 45%; }
.ot-rc-row dd { margin: 0; text-align: right; min-width: 0; }
.ot-rc-row.has-rule { border-top: 1px solid #e7e5e4; margin-top: 6px; padding-top: 8px; }
.ot-rc-row.is-strong dd { font-weight: 700; }
.ot-rc-note { font-size: 12px; color: #57534e; text-align: center; margin: 14px 0 0; }
.ot-rc-actions { width: 100%; max-width: 400px; }
.ot-rc-actions .ot-actions-row > .ot-btn { flex: 1 1 0; }

@media (max-width: 480px) {
  .ot-rc-item { flex-wrap: wrap; }
  .ot-rc-item-desc { flex: 1 1 100%; }
  .ot-rc-item-amount { flex: 1 1 auto; }
  .ot-rc-paper { padding: 20px 16px 18px; }
}

/* Print: only the receipt. receipt_maker_controller keeps a copy of the
   preview in .ot-rc-print-copy, a direct child of <body>. */
.ot-rc-print-copy { display: none; }
@media print {
  body > *:not(.ot-rc-print-copy) { display: none !important; }
  body { background: #fff !important; }
  .ot-rc-print-copy { display: block; padding: 0.25in 0 0; }
  .ot-rc-print-copy .ot-rc-paper { margin: 0 auto; max-width: 5.5in; box-shadow: none; border: 1px solid #e7e5e4; }
  .ot-rc-print-copy [hidden] { display: none !important; }
  .ot-rc-paper, .ot-rc-paid { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
