/* Namespaced modal only; no existing invoice, POS or receipt CSS is changed. */
#nxA4InvoiceDialog{box-sizing:border-box;width:min(1080px,96vw);max-width:96vw;height:94vh;max-height:94vh;margin:auto;padding:0;border:1px solid #c9b597;border-radius:15px;background:#f8f4ee;color:#362619;font:14px Tahoma,Arial,sans-serif;z-index:2147483000;box-shadow:0 20px 70px #0004;overflow:hidden}
#nxA4InvoiceDialog *{box-sizing:border-box}
#nxA4InvoiceDialog::backdrop{background:#20160db0}
#nxA4InvoiceDialog.nx-a4-fallback{display:block;position:fixed;inset:3vh 2vw}
#nxA4InvoiceDialog [hidden]{display:none!important}
#nxA4InvoiceDialog .nx-a4-bar{height:74px;display:flex;align-items:center;justify-content:space-between;padding:14px 22px;background:#543413;color:#fff}
#nxA4InvoiceDialog strong{font-size:17px}
#nxA4InvoiceDialog small{display:block;line-height:1.6}
#nxA4InvoiceDialog .nx-a4-subtitle{color:#edddc7;direction:rtl;margin-top:5px}
#nxA4InvoiceDialog .nx-a4-close{color:#fff;border:1px solid #aa895d;background:transparent;width:38px;height:38px;font-size:25px;border-radius:8px;cursor:pointer}
#nxA4InvoiceDialog .nx-a4-body{height:calc(100% - 74px);overflow:auto;padding:18px}
#nxA4InvoiceDialog .nx-a4-status{border:1px solid #cfbaa0;background:#fffaf1;padding:12px 16px;border-radius:9px;line-height:1.7;white-space:normal}
#nxA4InvoiceDialog .nx-a4-error{background:#fff0eb;border-color:#b0422b;color:#782b1d}
#nxA4InvoiceDialog .nx-a4-controls{padding:14px 4px}
#nxA4InvoiceDialog .nx-a4-customer{font-weight:700;margin-bottom:12px;overflow-wrap:anywhere}
#nxA4InvoiceDialog label{display:flex;gap:12px;align-items:center;font-weight:700}
#nxA4InvoiceDialog input{width:230px;max-width:65vw;padding:10px;background:#fff;border:1px solid #c9b597;border-radius:7px;font-size:16px;color:#362619}
#nxA4InvoiceDialog input[aria-invalid="true"]{border-color:#b34332}
#nxA4InvoiceDialog .nx-a4-controls>small{color:#716154;margin-top:5px}
#nxA4InvoiceDialog .nx-a4-actions{display:flex;flex-wrap:wrap;gap:10px;margin:14px 0 8px}
#nxA4InvoiceDialog .nx-a4-actions a,#nxA4InvoiceDialog .nx-a4-actions button{display:inline-flex;justify-content:center;align-items:center;padding:10px 16px;border:1px solid #bda583;border-radius:8px;background:#fff;color:#4d331c;cursor:pointer;font:700 14px Tahoma,Arial,sans-serif;text-decoration:none;min-height:43px}
#nxA4InvoiceDialog .nx-a4-actions .nx-a4-download{background:#563512;color:#fff}
#nxA4InvoiceDialog .nx-a4-actions .nx-a4-wa,#nxA4InvoiceDialog .nx-a4-actions .nx-a4-share{background:#edf6ec;border-color:#658454;color:#275c2d}
#nxA4InvoiceDialog .nx-a4-actions [aria-disabled="true"]{opacity:.45;cursor:not-allowed}
#nxA4InvoiceDialog p{font-size:13px;line-height:1.8;margin:7px 0;color:#665849}
#nxA4InvoiceDialog .nx-a4-previews{display:flex;flex-direction:column;align-items:center;gap:18px;padding:4px 0 12px}
#nxA4InvoiceDialog .nx-a4-previews img{display:block;width:min(760px,100%);height:auto;max-width:100%;box-shadow:0 3px 18px #432c1620;background:#fff}
@media(max-width:580px){#nxA4InvoiceDialog .nx-a4-bar{padding:10px 13px}#nxA4InvoiceDialog strong{font-size:14px}#nxA4InvoiceDialog .nx-a4-body{padding:10px}#nxA4InvoiceDialog .nx-a4-actions>*{flex:1 1 45%}}
@media print{#nxA4InvoiceDialog{display:none!important}}

/* Direct chat status is independent from PDF progress or success. */
#nxA4InvoiceDialog .nx-a4-chat-status{padding:12px 16px;margin-bottom:10px;border:1px solid #96b790;border-radius:9px;background:#f0f7ed;color:#244821;line-height:1.8;overflow-wrap:anywhere}
#nxA4InvoiceDialog[data-chat-state="blocked"] .nx-a4-chat-status,#nxA4InvoiceDialog[data-chat-state="missing-phone"] .nx-a4-chat-status{background:#fff4e5;border-color:#c6a66f;color:#644618}

/* PROD71: real PDF viewer and explicit file actions, distinct from chat links. */
#nxA4InvoiceDialog .nx-a4-file-box{position:relative;border:2px solid #9d7d48;border-radius:10px;background:#fffdf9;padding:12px;margin:10px 0}
#nxA4InvoiceDialog .nx-a4-file-meta{margin:12px 4px}
#nxA4InvoiceDialog .nx-a4-file-name{display:block;overflow-wrap:anywhere;font-size:15px;text-align:right}
#nxA4InvoiceDialog .nx-a4-file-size{margin-top:5px}
#nxA4InvoiceDialog .nx-a4-actions .nx-a4-open-pdf{background:#563512;color:#fff}
#nxA4InvoiceDialog .nx-a4-actions .nx-a4-download{background:#fff;color:#563512;border-width:2px}
#nxA4InvoiceDialog .nx-a4-actions button:disabled{opacity:.55;cursor:wait}
#nxA4InvoiceDialog .nx-a4-attach-note{font-weight:700;color:#47351f;background:#faf1df;padding:9px;border-radius:6px}
#nxA4InvoiceDialog .nx-a4-viewer h3{margin:8px 0}
#nxA4InvoiceDialog .nx-a4-pdf-frame{width:100%;height:64vh;min-height:350px;border:1px solid #c9b597;border-radius:8px;background:#fff}
#nxA4InvoiceDialog .nx-a4-images>summary,#nxA4InvoiceDialog .nx-a4-viewer>summary{padding:12px;font-weight:700;cursor:pointer}
#nxA4InvoiceDialog .nx-a4-file-box .nx-a4-actions>*{min-height:48px}
