/* Existing colours and geometry; shared refinements, no workflow changes. */
.pc-tooltip{position:fixed;z-index:10000;max-width:min(340px,calc(100vw - 24px));padding:9px 12px;border-radius:7px;background:#25394f;color:#fff;font:14px/1.4 Arial,sans-serif;box-shadow:0 4px 16px #15263830;pointer-events:none}
.pc-money-cell{text-align:right!important;font-variant-numeric:tabular-nums;white-space:nowrap;overflow-wrap:normal}.pc-money-cell .history-change-text{white-space:nowrap;overflow-wrap:normal}
.pc-money,.pc-money-cell>strong,.amount,.history-price-values,.history-delta{white-space:nowrap;font-variant-numeric:tabular-nums}
.pc-help{font:inherit;display:inline-flex;align-items:center;justify-content:center;border:1px solid #cbd5e1;border-radius:50%;width:23px;height:23px;padding:0;background:#f4f7fb;color:#4b6681;cursor:help;flex:none}
.progress-count .pc-help{border:0;background:transparent;vertical-align:middle}.progress-count .pc-help svg{display:block;width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.payment-actions{position:relative;display:inline-block;text-align:left;white-space:normal}
.payment-actions>summary{list-style:none;cursor:pointer;padding:7px 10px;border:1px solid #cbd5e1;border-radius:7px;background:#f4f7fb;font-size:14px;color:#31516c;white-space:nowrap}
.payment-actions>summary::-webkit-details-marker{display:none}
.payment-action-options{position:absolute;right:0;top:100%;z-index:20;width:270px;max-width:calc(100vw - 48px);padding:6px;border:1px solid #dce3ec;border-radius:9px;background:white;box-shadow:0 8px 24px #20385426}
.payment-action-options button.finance-delete{display:block;width:100%;margin:0;padding:9px 10px;text-align:left;border:0;border-radius:5px;background:white;color:#29435e;font-size:14px;white-space:normal}
.payment-action-options button:hover,.payment-action-options button:focus-visible{background:#edf3fa}
.payment-action-options small{display:block;margin-top:4px;font-size:13px;line-height:1.35;color:#64748b}
.payment-action-options .payment-danger{border-top:1px solid #ead7d7!important;border-radius:0!important;margin-top:4px!important;color:#a53630!important}
.finance-table-wrap:has(.payment-actions[open]){overflow:visible}
.payment-context{display:grid;grid-template-columns:auto 1fr;gap:6px 15px;padding:12px;border-radius:8px;background:#f4f7fb;font-size:14px}
.payment-context dt{color:#63758b}.payment-context dd{margin:0;overflow-wrap:anywhere}.payment-context [data-payer-summary]{grid-column:1 / -1}
.history-change-text{white-space:pre-wrap;overflow-wrap:anywhere;max-width:460px}.history-change-text summary{color:#356181;cursor:pointer}
.history-event-body table td,.excel-update-table td{vertical-align:top}.history-event-body table th{font-size:14px}.history-event-body table{font-size:14px}
.history-operation-note{padding:9px 12px;background:#f5f8fc;border-left:3px solid #91b2d0;font-size:14px;line-height:1.4}
.history-event-body .history-part{border-top:1px solid #e1e8f0;padding-top:12px;margin-top:12px}
/* Orders and Calculations share the existing compact invoice-card layout. */
:is(#orders,#records) .invoice-list-card{display:grid;grid-template-columns:minmax(0,1fr) max-content;gap:4px 9px;align-items:center;align-content:start;align-self:start;height:auto;min-height:0;padding:7px 10px;margin-bottom:4px;border-radius:14px;font-family:Inter,Segoe UI,Arial,sans-serif;font-size:14px;text-align:left}
#orders.orders .invoice-list-card{grid-template-columns:22px 4px minmax(0,1fr) max-content}
:is(#orders,#records) .invoice-list-card.selected,:is(#orders,#records) .invoice-list-card.active{background:linear-gradient(90deg,#f1f8ff 0%,#fff 72%);border-color:#91c5ef;box-shadow:0 5px 18px rgba(18,104,173,.12)}
:is(#orders,#records) .invoice-list-card.selected:before,:is(#orders,#records) .invoice-list-card.active:before{content:'';position:absolute;left:-1px;top:10px;bottom:10px;width:3px;border-radius:0 4px 4px 0;background:#147be0}
:is(#orders,#records) .invoice-list-card:focus-visible{outline:3px solid #8cc4ed;outline-offset:1px}
:is(#orders,#records) .invoice-card-info{min-width:0}
:is(#orders,#records) .invoice-card-info .num{display:block;font-size:15px;font-weight:900;line-height:18px;color:#123b5e}
:is(#orders,#records) .invoice-card-info .buyer{display:block;font-size:15px;font-weight:700;line-height:19px;margin-top:2px;color:#60788d;white-space:normal;overflow-wrap:anywhere}
:is(#orders,#records) .invoice-card-statuses{display:flex!important;flex-direction:column;align-items:flex-end;justify-content:flex-start;justify-self:end;flex-wrap:nowrap;gap:4px;margin:0;width:max-content;max-width:none}
:is(#orders,#records) .invoice-card-statuses>span{display:inline-flex!important;flex-direction:column;align-self:auto;flex:0 0 auto;width:max-content;min-width:0;max-width:none;min-height:0;margin:0;padding:3px 7px;border-radius:8px;font-size:12px!important;font-weight:750!important;line-height:16px;gap:3px;white-space:nowrap;overflow-wrap:normal;text-align:left}
:is(#orders,#records) .invoice-card-statuses>span>span{margin:0;font:inherit;line-height:inherit;white-space:nowrap;overflow-wrap:normal}
:is(#orders,#records) .invoice-card-statuses i{display:block;width:100%;min-width:0;height:3px;border-radius:99px;background:#e3ebef;overflow:hidden}
:is(#orders,#records) .invoice-card-statuses i b{display:block;height:100%;border-radius:99px;background:#14b86c}
:is(#orders,#records) .invoice-card-statuses .payment-badge.paid,:is(#orders,#records) .invoice-card-statuses .badge.ready{background:#f0faf5;border-color:#c5e7d6;color:#087f49}
:is(#orders,#records) .invoice-card-statuses .payment-badge.partial{background:#f5faff;border-color:#cfdfed;color:#286590}
:is(#orders,#records) .invoice-card-statuses .payment-badge.unpaid,:is(#orders,#records) .invoice-card-statuses .payment-badge.unknown{background:#fff;border-color:#d7e3ec;color:#586f82}
body.pc-calculations #orders .order-info{display:flex;flex-direction:column;align-items:flex-start;gap:0}
body.pc-calculations #orders .order:not(.active):before{content:none}
body.pc-calculations #orders .calc-list-profit{display:block;margin-top:3px;font-size:14px;font-weight:600;line-height:18px}
body.pc-calculations #orders .calc-list-meta{display:block;margin-top:3px;font-size:11px;font-weight:400;line-height:15px;color:#72879a}
body.pc-calculations #detail th{font-size:12px}
body.pc-calculations #detail td{font-size:14px;line-height:1.35}
body.pc-calculations #detail td input:not([type=checkbox]),body.pc-calculations #detail td select{font-size:14px;height:32px;padding:5px 6px}
body.pc-calculations #detail .kit-caption,body.pc-calculations #detail .legacy-purchase{font-size:12px}
/* Keep narrow panes usable without clipping status labels or hiding table columns. */
@media(max-width:700px){:is(#orders,#records) .invoice-list-card{grid-template-columns:minmax(0,1fr)}#orders.orders .invoice-list-card{grid-template-columns:22px 4px minmax(0,1fr)}#orders.orders .invoice-list-card>.right{grid-column:3}:is(#orders,#records) .invoice-card-statuses{flex-direction:row;flex-wrap:wrap;width:auto;justify-content:flex-end;max-width:100%}}
body.pc-supply .detail-head{gap:12px;margin-bottom:12px}body.pc-supply .logistics-actions{gap:6px;flex-wrap:wrap}body.pc-supply .logistics-actions .btn{min-height:34px;font-size:14px}
.payment-operation button,.excel-update-actions button,.history-review-form button{min-height:34px;font-size:14px}
@media print{.pc-tooltip,.pc-help,.payment-actions{display:none!important}}

.finance-kpis strong,.finance-payment-numbers strong,.finance-table td:nth-child(2){overflow-wrap:normal;white-space:nowrap;font-variant-numeric:tabular-nums}.finance-table td small{white-space:normal;overflow-wrap:normal}.finance-table{font-size:14px}.finance-table th{font-size:13px}.finance-table small{font-size:13px}

#orders .invoice-card-statuses .production-badge.work,#orders .invoice-card-statuses .production-badge.shipped,#orders .invoice-card-statuses .production-badge.not-started,#orders .invoice-card-statuses .payment-badge.unpaid{background:#f5faff;border-color:#cfdfed;color:#286590}
