/* Proforma-specific controls; the original invoice styles remain shared. */
.proforma-payment-toggle{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:12px;margin:7px 0 2px;font-size:.78rem;color:#536174}
.proforma-payment-toggle button{border:1px solid #d7dfe5;background:#fff;color:#34485a;border-radius:6px;padding:4px 9px;font-size:.75rem}
.proforma-payment-toggle button:hover{background:#f3f6fa}
@media(max-width:767px){.proforma-payment-toggle{justify-content:flex-start}}
@media print{.proforma-payment-toggle{display:none!important}}

.invoice-logo-area{position:relative}
.proforma-remove-logo{position:absolute;right:4px;top:4px;width:25px;height:25px;line-height:20px;border:1px solid #d5dbe2;border-radius:50%;color:#424c57;background:#fff;font-size:17px;font-weight:700;cursor:pointer;z-index:2}
.proforma-remove-logo:hover{color:#ad2737;border-color:#dfb2ba}
.proforma-remove-logo[hidden]{display:none!important}
.invoice-pdf-host .proforma-remove-logo{display:none!important}


/* Proforma status picker: opening it always shows every status, even when an
   existing value is present. Custom statuses remain editable in the text field. */
.proforma-method-row.is-open{position:relative;z-index:50}
.proforma-method-combobox{position:relative;min-width:0;width:100%}
.invoice-paper .proforma-method-combobox input[data-field="proformaStatus"]{width:100%;padding-right:32px}
.proforma-method-toggle {
    position: absolute;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    height: 100%;
    max-height: 35px;
    width: 29px;
    border: 0;
    background: transparent;
    color: #59677a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    font-size: 17px;
    line-height: 1;
}
.proforma-method-toggle span {
    display: block;
    line-height: 1;
}
.proforma-method-toggle:focus-visible{outline:2px solid #b48b44;outline-offset:-2px;border-radius:4px}
.proforma-method-toggle[aria-expanded="true"] span{transform:rotate(180deg)}
.proforma-method-options{position:absolute;right:0;top:calc(100% + 4px);min-width:100%;width:max(100%,205px);max-width:min(285px,calc(100vw - 48px));max-height:320px;overflow-y:auto;overscroll-behavior:contain;background:#fff;color:#182536;border:1px solid #d8dfe8;border-radius:7px;box-shadow:0 8px 22px rgba(16,32,56,.16);z-index:60;padding:4px 0}
.proforma-method-options[hidden]{display:none!important}
.proforma-method-options button[role="option"]{display:block;width:100%;min-height:34px;padding:8px 12px;border:0;background:#fff;color:#182536;text-align:left;font-size:.82rem;line-height:1.4;cursor:pointer;white-space:normal}
.proforma-method-options button[role="option"]:hover,.proforma-method-options button[role="option"].is-active{background:#f0f4fa;color:#172d53}
.proforma-method-options button[role="option"][aria-selected="true"]{font-weight:700}
.proforma-method-options button[role="option"][hidden]{display:none!important}
@media print{.proforma-method-options,.proforma-method-toggle{display:none!important}}
.invoice-pdf-host .proforma-method-options,.invoice-pdf-host .proforma-method-toggle{display:none!important}

/* Optional deposit schedule: leave the remaining-balance row out until a deposit is entered. */
.invoice-total-row[hidden],.invoice-pdf-host .invoice-total-row[hidden]{display:none!important}
/* Free-text proforma invoice dates with an optional native calendar shortcut. The text
   fields have no required/date-format restriction and can be completely blank. */
.invoice-paper .proforma-date-field{position:relative;min-width:0;width:100%}
.invoice-paper .proforma-date-field>input[data-field]{box-sizing:border-box;min-width:0;width:100%;padding-right:36px}
.proforma-date-picker-toggle{position:absolute;right:3px;top:50%;transform:translateY(-50%);width:29px;height:29px;display:flex;align-items:center;justify-content:center;padding:0;border:0;background:transparent;color:inherit;opacity:.78;cursor:pointer;z-index:1}
.proforma-date-picker-toggle:hover{opacity:1}
.proforma-date-picker-toggle:focus-visible{opacity:1;outline:2px solid #b48b44;outline-offset:0;border-radius:4px}
/* Keep the native control rendered so showPicker works in supported browsers;
   it isn't a persisted field and never appears in the generated PDF. */
.invoice-paper .proforma-date-native-picker{position:absolute!important;right:2px!important;top:calc(100% - 1px)!important;width:1px!important;min-width:0!important;height:1px!important;padding:0!important;border:0!important;opacity:0!important;pointer-events:none!important;overflow:hidden!important}
@media print{.proforma-date-picker-toggle,.proforma-date-native-picker{display:none!important}}
.invoice-pdf-host .proforma-date-picker-toggle,.invoice-pdf-host .proforma-date-native-picker{display:none!important}
.proforma-method-options[hidden]{display:none!important}

/* The PDF uses wrapping text instead of a single-line input for custom dates.
   This keeps long phrases fully visible rather than clipping their last words. */
.invoice-pdf-host .proforma-pdf-date-value{box-sizing:border-box;min-width:0;width:100%;margin:0;padding:0;text-align:inherit;font:inherit;color:inherit;line-height:1.45;white-space:pre-wrap;overflow-wrap:anywhere;word-break:normal}

/* Optional international-trade details preserve the shared invoice layout across themes. */
.proforma-trade-details{margin:16px 0 20px;padding:14px 16px;border:1px solid var(--invoice-line,#dfe5eb);border-radius:8px;color:var(--invoice-ink,#26354a)}
.proforma-trade-title{font-size:.83rem;font-weight:800;letter-spacing:.01em;margin-bottom:10px}
.proforma-trade-title small{font-size:.72rem;font-weight:400;opacity:.65}
.proforma-trade-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:18px;row-gap:11px}
.proforma-trade-grid .proforma-trade-field,.proforma-trade-static{display:flex;flex-direction:column;min-width:0;gap:4px;margin:0}
.proforma-trade-grid .proforma-trade-field>span,.proforma-trade-static strong{font-size:.7rem;font-weight:700;line-height:1.35}
.proforma-trade-grid input{box-sizing:border-box;width:100%;height:36px;padding:7px 9px;border:1px solid var(--invoice-line,#dfe5eb);border-radius:5px;background:transparent;color:inherit;font-size:.78rem}
.proforma-trade-grid input:focus{outline:2px solid #b48b44;outline-offset:1px}
.proforma-disclaimer-section{margin:14px 0 8px;padding:10px 14px;border-left:3px solid var(--invoice-accent,#778ba8);background:rgba(90,111,134,.055);border-radius:3px}
.proforma-disclaimer-label{display:block;font-size:.7rem;font-weight:800;margin-bottom:4px}
.proforma-disclaimer-text{box-sizing:border-box;width:100%;min-height:50px;resize:vertical;line-height:1.45;font-size:.73rem;color:inherit;border:0;background:transparent;padding:0;margin:0}
.invoice-pdf-host .proforma-trade-details{break-inside:avoid-page;page-break-inside:avoid}
.invoice-pdf-host .proforma-trade-static span{white-space:pre-wrap;overflow-wrap:anywhere;font-size:.78rem}
.invoice-pdf-host .proforma-trade-grid{row-gap:9px}
.invoice-pdf-host .proforma-disclaimer-section{break-inside:avoid-page;page-break-inside:avoid}
.invoice-pdf-host .proforma-disclaimer-text{height:auto!important;min-height:0!important;resize:none!important;white-space:pre-wrap;overflow-wrap:anywhere}
@media(max-width:520px){.proforma-trade-grid{grid-template-columns:1fr}.proforma-trade-details{padding:11px}}

/* Proforma documents use a longer headline than quotes; keep it legible in every theme. */
.invoice-paper .invoice-title-input{font-size:clamp(1.25rem,2.55vw,1.85rem)!important;min-width:0!important;letter-spacing:-.015em}
.invoice-pdf-host .invoice-title-input{font-size:28px!important}

/* Editable proforma-specific captions behave like the other editable invoice labels.
   Give them a visible caret/keyboard focus without changing the PDF appearance. */
.invoice-paper .proforma-custom-label{cursor:text;white-space:pre-wrap;overflow-wrap:anywhere;min-width:0}
.invoice-paper .proforma-custom-label:hover{background:rgba(75,115,156,.055)}
.invoice-paper .proforma-custom-label:focus{outline:2px solid #b48b44;outline-offset:2px;border-radius:2px;background:rgba(75,115,156,.045)}
.invoice-pdf-host .proforma-custom-label{cursor:default;outline:0!important;background:transparent!important}
