/* Specific document, signature and print styles for Basi Workflow */
.terms, #modal-terms { white-space: pre-line; }
.price-box { padding: 24px; background: #0f2346; color: white; border-radius: 14px; font-weight: bold; font-size: 36px; }
.price-box small { display: block; font-size: 13px; font-weight: normal; margin-top: 6px; }
.signature-canvas { touch-action: none; cursor: crosshair; border: 1px dashed #8b9bb1; border-radius: 8px; width: 100%; height: 170px; background: white; }
.table-scroll { overflow-x: auto; margin-top: 24px; }
.order-document { background: white; color: #172033; text-align: left; padding: 20px; font: 13px/1.45 Arial, Helvetica, sans-serif; }
.order-document h1 { border-bottom: 3px solid #173f7c; padding-bottom: 12px; }
.order-document tr { break-inside: avoid; }
.order-document table { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 24px; }
.order-document th, .order-document td { padding: 10px 8px; text-align: left; border-bottom: 1px solid #d7dee7; vertical-align: top; }
.order-document th { background: #edf2f7; }
.order-document th:last-child, .order-document td:last-child { text-align: right; }
.order-document .totals { text-align: right; font-size: 15px; margin-top: 16px; }
.order-document .signed-image { display: block; width: auto; max-width: 240px; max-height: 100px; }
.order-document small { overflow-wrap: anywhere; }
.document-actions { padding: 16px 0; display: flex; gap: 10px; }
.document-actions button { border: 0; border-radius: 9px; background: #FEC604; color: black; font-weight: bold; padding: 10px 18px; cursor: pointer; }
.pdf-export .order-document { padding: 0; }
.pdf-export table { font-size: 11px; }
.pdf-export th, .pdf-export td { padding: 8px 4px; }
.document-print { background: white; }
.document-print .order-document { max-width: 100%; padding: 0; }
#admin-error, #sign-error { color: #9f1239; }
#internal-document:not(:empty) { margin-top: 30px; border-top: 3px solid #16428b; }
input[type=number] { -moz-appearance: textfield; }
input[type=number]::-webkit-inner-spin-button { appearance: none; }

/* Admin and standalone fallback */
.simple-header { padding: 20px; background: #0f172a; color: #fff; font-weight: bold; }
.simple-main { max-width: 900px; margin: 30px auto; padding: 26px; background: #fff; border: 1px solid #dce3ec; border-radius: 16px; }
.simple-main.wide { max-width: 1320px; }

@media (max-width: 640px) {
    .simple-main { margin: 12px; padding: 16px; }
    .order-document { padding: 8px; }
    .order-document table { font-size: 10px; }
    .order-document th, .order-document td { padding: 6px 3px; }
    .price-box { font-size: 30px; }
}

@media print {
    @page { size: A4; margin: 14mm; }
    body { background: #fff; }
    body[data-customer-page="true"]:not(.has-signed-document) { display: none !important; }
    .simple-header, .document-actions, #login-form, #refresh, #retry, #logout, #admin-error, #navbar, footer, aside { display: none !important; }
    .document-print .order-document { display: block !important; }
    body.has-signed-document main, body.has-signed-document #confirmation-modal { position: static !important; max-height: none !important; overflow: visible !important; background: white !important; padding: 0 !important; }
    body.has-signed-document #modal-view-post-sign { max-height: none !important; overflow: visible !important; }
    body.has-signed-document main > div:not(#signing-content), body.has-signed-document header, body.has-signed-document #modal-view-pre-sign, body.has-signed-document button { display: none !important; }
    .order-document { box-shadow: none; border: 0; padding: 0; }
    .order-document tr { break-inside: avoid; }
    .simple-main { max-width: 100%; border: 0; margin: 0; padding: 0; }
}
