/* Work-order-specific controls; the original invoice styles remain shared. */
.quote-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}
.quote-payment-toggle button{border:1px solid #d7dfe5;background:#fff;color:#34485a;border-radius:6px;padding:4px 9px;font-size:.75rem}
.quote-payment-toggle button:hover{background:#f3f6fa}
@media(max-width:767px){.quote-payment-toggle{justify-content:flex-start}}
@media print{.quote-payment-toggle{display:none!important}}

.invoice-logo-area{position:relative}
.quote-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}
.quote-remove-logo:hover{color:#ad2737;border-color:#dfb2ba}
.quote-remove-logo[hidden]{display:none!important}
.invoice-pdf-host .quote-remove-logo{display:none!important}


/* Work-order status picker: opening it always shows every status, even when an
   existing value is present. Custom statuses remain editable in the text field. */
.quote-method-row.is-open{position:relative;z-index:50}
.quote-method-combobox{position:relative;min-width:0;width:100%}
.invoice-paper .quote-method-combobox input[data-field="workStatus"]{width:100%;padding-right:32px}
.quote-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;
}
.quote-method-toggle span {
    display: block;
    line-height: 1;
}
.quote-method-toggle:focus-visible{outline:2px solid #b48b44;outline-offset:-2px;border-radius:4px}
.quote-method-toggle[aria-expanded="true"] span{transform:rotate(180deg)}
.quote-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}
.quote-method-options[hidden]{display:none!important}
.quote-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}
.quote-method-options button[role="option"]:hover,.quote-method-options button[role="option"].is-active{background:#f0f4fa;color:#172d53}
.quote-method-options button[role="option"][aria-selected="true"]{font-weight:700}
.quote-method-options button[role="option"][hidden]{display:none!important}
@media print{.quote-method-options,.quote-method-toggle{display:none!important}}
.invoice-pdf-host .quote-method-options,.invoice-pdf-host .quote-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 work-order dates with an optional native calendar shortcut. The text
   fields have no required/date-format restriction and can be completely blank. */
.invoice-paper .quote-date-field{position:relative;min-width:0;width:100%}
.invoice-paper .quote-date-field>input[data-field]{box-sizing:border-box;min-width:0;width:100%;padding-right:36px}
.quote-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}
.quote-date-picker-toggle:hover{opacity:1}
.quote-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 .quote-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{.quote-date-picker-toggle,.quote-date-native-picker{display:none!important}}
.invoice-pdf-host .quote-date-picker-toggle,.invoice-pdf-host .quote-date-native-picker{display:none!important}
.quote-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 .quote-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}

/* Work-order lines can be identified as labor, materials, equipment, or service. */
.invoice-paper .work-order-line-kind{display:block;width:100%;max-width:200px;margin:5px 0 0;padding:3px 5px;border:1px solid var(--invoice-line,#d9e0e8);border-radius:4px;background:transparent;color:var(--invoice-muted,#576275);font-size:.72rem;line-height:1.3}
.invoice-pdf-host .work-order-line-category{margin-top:5px;color:var(--invoice-muted,#576275);font-size:12px;line-height:1.35;white-space:normal}
.work-order-signoff{margin-top:13px;display:grid;grid-template-columns:1fr 1fr;gap:8px 12px}
.work-order-signoff .invoice-editable-label{margin:0 0 3px}
.work-order-signoff input{width:100%;min-width:0;padding:5px 6px;border:1px solid var(--invoice-line,#d9e0e8);border-radius:4px;background:transparent;color:inherit;font:inherit;font-size:.79rem}
.invoice-pdf-host .work-order-signoff{break-inside:avoid;page-break-inside:avoid}
.invoice-pdf-host .work-order-signoff input{padding-left:0;padding-right:0;border:0!important;box-shadow:none!important;background:transparent!important}
.work-order-document-notice{margin-top:10px;font-size:.73rem;color:var(--invoice-muted,#5f6b79);line-height:1.45}
@media(max-width:480px){.work-order-signoff{grid-template-columns:1fr}}

/* Every heading printed on the work order remains directly editable in the
   editor. Keep the inherited theme typography/layout rather than introducing
   inputs, while overriding shared theme rules that disable selection. */
body .invoice-paper [data-label-key] {
    pointer-events: auto !important;
    user-select: text !important;
    -webkit-user-select: text !important;
    cursor: text !important;
    caret-color: currentColor;
    min-width: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    touch-action: manipulation;
}
body .invoice-paper [data-label-key]:hover {
    box-shadow: inset 0 -1px 0 currentColor;
}
body .invoice-paper [data-label-key]:focus {
    outline: 1px dashed currentColor !important;
    outline-offset: 3px;
    border-radius: 2px;
}
/* Never print editor-only focus/hover decoration. */
@media print {
    body .invoice-paper [data-label-key] { outline: none !important; box-shadow: none !important; }
}
.invoice-pdf-host .invoice-paper [data-label-key] {
    outline: none !important; box-shadow: none !important; cursor: default !important;
}

/* A cleared label remains visible/clickable and can be edited again. */
body .invoice-paper [data-label-key]:empty::before {
    content: attr(data-empty-label-placeholder);
    opacity: .45;
    font-weight: normal;
}

/* 2026-10-14: Consistent, vertically centered dropdown arrows in all ten themes.
   Use an SVG chevron rather than a font glyph, which sits at different baselines. */
body .invoice-paper .quote-method-combobox > input[role="combobox"] {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
    padding-right: 36px !important;
}
body .invoice-paper .quote-method-combobox > .quote-method-toggle {
    position: absolute !important;
    top: 50% !important;
    right: 2px !important;
    bottom: auto !important;
    left: auto !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 28px !important;
    min-width: 28px !important;
    height: 28px !important;
    min-height: 28px !important;
    max-height: 28px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 4px;
    background: transparent !important;
    color: inherit !important;
    opacity: .75;
    line-height: 0 !important;
    box-sizing: border-box !important;
    cursor: pointer !important;
    z-index: 2;
}
body .invoice-paper .quote-method-combobox > .quote-method-toggle:hover {opacity: 1}
body .invoice-paper .quote-method-toggle > .work-order-chevron {
    display: block !important;
    position: static !important;
    width: 16px !important;
    height: 16px !important;
    flex: none;
    margin: 0 !important;
    padding: 0 !important;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transform: none;
    transform-origin: center;
    transition: transform .14s ease;
}
body .invoice-paper .quote-method-toggle[aria-expanded="true"] > .work-order-chevron {
    transform: rotate(180deg) !important;
}
/* Never let the Priority/Status list disappear behind another metadata row. */
body .invoice-paper .invoice-meta-row.quote-method-row.is-open {position: relative !important; z-index: 80 !important}

/* Give quantity enough room for practical hourly/part counts and decimals. */
body .invoice-paper .invoice-items-table thead th:nth-child(2),
body .invoice-paper .invoice-items-table tbody td:nth-child(2) {
    box-sizing: border-box;
    width: 112px !important;
    min-width: 105px !important;
}
body .invoice-paper .invoice-items-table tbody input.invoice-qty-input[data-qty] {
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 85px !important;
    max-width: none !important;
}

/* Line item kind: manual text plus optional suggestions. */
body .invoice-paper .work-order-kind-combobox {
    display: block;
    position: relative;
    width: min(100%, 228px);
    min-width: 0;
    margin-top: 5px;
}
body .invoice-paper .work-order-kind-combobox > input.work-order-line-kind {
    display: block !important;
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    min-height: 29px !important;
    padding: 4px 33px 4px 7px !important;
    border: 1px solid var(--invoice-line,#d9e0e8) !important;
    border-radius: 4px !important;
    background: transparent !important;
    color: inherit !important;
    font-size: .76rem !important;
    line-height: 1.35 !important;
    text-align: left !important;
}
body .invoice-paper .work-order-kind-combobox > .quote-method-toggle {
    width: 26px !important;
    min-width: 26px !important;
    height: 26px !important;
    min-height: 26px !important;
    max-height: 26px !important;
}
/* These popovers live under <body> while open so the items table's mobile
   horizontal scrolling and theme overflow cannot clip the options. */
body > .work-order-kind-options:not([hidden]) {
    position: fixed !important;
    z-index: 100000 !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    min-width: 0 !important;
    overflow-y: auto !important;
    background: #fff !important;
}
@media print {
    body .invoice-paper .quote-method-toggle,
    body > .work-order-kind-options { display: none !important; }
}
