.costing-toolbar,.costing-parameters,.costing-summary {display:flex;gap:16px;flex-wrap:wrap;align-items:end;margin:18px 0}
.costing-toolbar label,.costing-parameters label {display:grid;gap:8px;flex:1;min-width:160px}
.costing-parameters {padding:20px;background:#f2f6ff;border-radius:14px}
.costing-summary span {padding:14px;background:#eef7f2;border-radius:10px;display:grid;gap:8px;min-width:180px}
.costing-summary strong {font-size:22px}
.costing-scroll {overflow:visible;max-height:none}
.costing-table {border-collapse:collapse;min-width:1800px;width:100%}
.costing-table td,.costing-table th {border:1px solid #dce4f0;padding:10px;text-align:right}
.costing-table th {background:#eef2fb;position:sticky;top:0;z-index:1;text-align:center}
.costing-table input {width:100%;min-width:80px}

.costing-currency-pair {display:flex;align-items:center;gap:8px}
.costing-photo-button {padding:2px;display:block;margin-bottom:8px;background:white}
.costing-photo-button img {object-fit:contain}

.costing-parameters {display:grid;grid-template-columns:minmax(320px,2fr) minmax(420px,3fr) minmax(220px,1fr);align-items:start;gap:24px}
.costing-rate-fields,.costing-payment-fields {display:grid;gap:16px;align-items:start}
.costing-rate-fields {grid-template-columns:repeat(2,minmax(0,1fr))}
.costing-payment-fields {grid-template-columns:repeat(3,minmax(0,1fr));padding-top:0}
.costing-parameters label {min-width:0;display:flex;flex-direction:column;gap:10px;align-items:stretch}
.costing-parameters input,.costing-parameters select,.costing-parameters button {min-height:44px;margin:0;width:100%;box-sizing:border-box}
.costing-parameters small {font-size:12px;color:#52627b}
.costing-summary {display:grid;grid-template-columns:repeat(5,minmax(0,1fr));align-items:stretch}
.costing-summary span {min-width:0;align-content:space-between;gap:16px}
.costing-table .costing-zone-head th {top:0;height:42px;box-sizing:border-box;font-size:16px;z-index:3}
.costing-table .costing-column-head th {top:42px;z-index:2}
.costing-table .costing-zone-purchase {background:#dceafe;color:#1c4d88}
.costing-table .costing-zone-shipping {background:#e7dcff;color:#513783}
.costing-table .costing-zone-sales {background:#daf1e1;color:#23623b}
.costing-column-head select {display:block;width:100%;margin-top:8px;min-height:36px}
@media(max-width:1400px) {.costing-parameters {grid-template-columns:1fr 1fr}.costing-bulk-field {grid-column:1/-1}.costing-summary {grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:800px) {.costing-parameters {grid-template-columns:1fr}.costing-payment-fields {grid-template-columns:1fr}.costing-summary {grid-template-columns:1fr 1fr}}


.costing-summary .costing-unbalanced {background:#fdeaea;color:#922d2d}
.costing-summary .costing-balanced {background:#e5f5e9;color:#24643a}
.costing-shoe-bulk {display:flex;flex-wrap:wrap;gap:16px;background:#fff5df;padding:18px;border-radius:12px;margin:16px 0}
.costing-shoe-bulk h3 {width:100%;margin:0}
.costing-shoe-bulk label {display:grid;gap:8px;flex:1;min-width:220px}
.costing-table .costing-zone-additional {background:#ffedc5;color:#805f14}



.costing-single-rate {grid-template-columns:1fr}

.costing-row-actions {display:grid;gap:8px;min-width:185px}
.costing-row-actions button {width:100%;white-space:nowrap}

/* Semantic zones keep headers and cells aligned when form columns change. */
.costing-table {table-layout:fixed;min-width:100%;border-collapse:separate;border-spacing:0;font-size:14px}
.costing-table td,.costing-table th {box-sizing:border-box;border-width:0 1px 1px 0;padding:12px;vertical-align:middle;line-height:1.35}
.costing-table tr > :first-child {border-left-width:1px}
.costing-table .costing-zone-head th {height:44px;white-space:nowrap;border-top-width:1px}
.costing-table .costing-column-head th {top:44px;height:112px;font-size:14px}
.costing-table thead [data-cost-zone="purchase"] {background:#f5f9ff}
.costing-table thead [data-cost-zone="shipping"] {background:#f5f0ff}
.costing-table thead [data-cost-zone="additional"] {background:#fff7e6}
.costing-table thead [data-cost-zone="sales"] {background:#effaf2}
.costing-table thead [data-cost-zone="actions"] {background:#f8fafc}
.costing-table .costing-zone-actions {background:#e8edf4;color:#40516b}
.costing-table input,.costing-table select {min-width:0;max-width:100%;width:100%;box-sizing:border-box;font-size:14px}
.costing-table input {min-height:40px;text-align:right;padding:8px}
.costing-table [data-cost-column="name"] {text-align:left}
.costing-table [data-cost-column="name"] input {text-align:left}
.costing-table td {font-variant-numeric:tabular-nums}
.costing-table .costing-photo-button {width:76px;height:76px;padding:5px;margin:0 auto 10px;background:white;border:1px solid #dce4f0;border-radius:8px}
.costing-photo-button img {display:block;width:64px;height:64px;margin:auto;object-fit:contain}
.costing-row-actions {min-width:0;gap:8px}
.costing-row-actions button {min-height:40px;font-size:13px;padding:8px 6px;white-space:normal;line-height:1.25}

.costing-product-card {position:relative;width:100%;height:150px;border:1px solid #dce4f0;border-radius:8px;overflow:hidden;background:#fff}
.costing-table .costing-product-image {display:block;width:100%;height:100%;padding:0;margin:0;border:0;border-radius:0;background:#fff;cursor:zoom-in}
.costing-product-image img {display:block;width:100%;height:100%;object-fit:contain}
.costing-product-empty {display:grid;place-items:center;height:100%;color:#7c899b;font-size:13px;background:#edf1f6}
.costing-table .costing-product-name {position:absolute;top:5px;left:5px;width:calc(100% - 10px);height:49px;min-height:49px;box-sizing:border-box;padding:5px 7px;border:1px solid #42536d;border-radius:5px;background:rgba(24,43,74,.92);color:#fff;font-size:15.4px;line-height:1.2;resize:none;text-align:left;font-family:inherit}
.costing-product-name::placeholder {color:#e0e6ef}
.costing-table .costing-product-sku {position:absolute;right:5px;bottom:5px;width:115px;max-width:calc(100% - 10px);min-height:31px;height:31px;padding:4px 6px;background:#fff;color:#182b4a;border:1px solid #d1dae6;border-radius:5px;font-size:15.4px;text-align:left}
.costing-product-name:focus,.costing-product-sku:focus {outline:2px solid #5799eb;outline-offset:0}



.costing-crm-status {font-size:12px;line-height:1.4;text-align:left;overflow-wrap:anywhere}
.costing-crm-status[data-state="error"] {color:#a52e2e;background:#fdeaea;padding:6px;border-radius:5px}
.costing-crm-status[data-state="success"] {color:#24643a}

.costing-scroll {overflow:visible;max-height:none}
.costing-table {width:100%;min-width:0;table-layout:fixed;font-size:12px}
.costing-table td,.costing-table th {padding:6px;overflow-wrap:anywhere}
.costing-table .costing-zone-head th {height:34px;font-size:13px;white-space:normal;position:static}
.costing-table .costing-column-head th {height:82px;font-size:12px;position:static}
.costing-table input,.costing-table select {font-size:12px;min-height:32px;padding:4px}
.costing-column-head select {min-height:30px;margin-top:5px}
.costing-table input[type="number"] {-moz-appearance:textfield}
.costing-table input[type="number"]::-webkit-inner-spin-button,.costing-table input[type="number"]::-webkit-outer-spin-button {-webkit-appearance:none;margin:0}
.costing-row-actions button {font-size:11px;min-height:30px;padding:5px 3px}
.costing-product-card {height:132px}
.costing-table .costing-product-name {font-size:15.4px;height:49px;min-height:49px;padding:4px}
.costing-table .costing-product-sku {font-size:15.4px;width:106px;height:30px;min-height:30px}
.costing-compact-bulk {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin:12px 0;padding:12px}
.costing-compact-bulk label {min-width:0;display:grid;grid-template-columns:minmax(80px,1fr) minmax(160px,1fr);gap:8px;font-size:13px;align-items:center}
.costing-compact-bulk input {grid-column:1;grid-row:2;width:100%;box-sizing:border-box;height:38px;min-height:38px;margin:0;padding:6px 10px}
.costing-compact-bulk button {grid-column:2;grid-row:2;width:100%;box-sizing:border-box;height:38px;min-height:38px;margin:0;font-size:12px;padding:6px;line-height:1.2}
.costing-bulk-caption {grid-column:1/-1;grid-row:1;line-height:1.4}
@media(max-width:850px){.costing-compact-bulk {grid-template-columns:1fr}}

.costing-row-actions button:disabled {cursor:default;opacity:.65}
.costing-row-actions button:disabled[data-export-state="pending"] {cursor:wait}
.costing-row-actions button:disabled[data-export-state="done"] {cursor:default;background:#edf4ee;border-color:#d4e4d7;color:#45604c;opacity:1}


.costing-shoe-parameters {grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}
.costing-shoe-parameters .costing-rate-fields,.costing-shoe-parameters .costing-payment-fields {display:contents}
.costing-shoe-parameters .costing-param-caption {min-height:48px;display:flex;align-items:end}
@media(max-width:800px){.costing-shoe-parameters {grid-template-columns:1fr}.costing-shoe-parameters .costing-param-caption {min-height:0}}

.costing-photo-upload {display:block;margin-top:6px;padding:7px 4px;border:1px solid #c7d6ec;border-radius:6px;background:#fff;color:#284e8b;text-align:center;font-size:12px;cursor:pointer}
.costing-photo-upload:focus-within {outline:2px solid #5799eb}

.costing-photo-upload {position:relative;overflow:hidden}
.costing-photo-upload .costing-photo-input {position:absolute;inset:0;width:100%;height:100%;opacity:0;cursor:pointer}

.costing-photo-upload.costing-photo-edit {display:grid;place-items:center;width:34px;height:34px;box-sizing:border-box;margin-left:auto;padding:6px}
.costing-photo-edit:hover {background:#edf3ff;border-color:#7fa3d8}
.costing-photo-edit svg {pointer-events:none}

.costing-product-footer {position:absolute;left:5px;right:5px;bottom:5px;display:flex;align-items:center;gap:6px}
.costing-product-footer .costing-photo-upload.costing-photo-edit {flex:0 0 30px;width:30px;height:30px;margin:0;padding:4px}
.costing-table .costing-product-footer .costing-product-sku {position:static;flex:1;min-width:0;width:0;max-width:none}

.costing-workflow-dialog {width:min(1100px,94vw);max-height:92vh;box-sizing:border-box;border:0;border-radius:14px;padding:22px;color:#172d49;overflow:auto}
.costing-workflow-dialog::backdrop {background:rgba(15,30,50,.6)}
.costing-workflow-dialog header {display:flex;align-items:center;justify-content:space-between;gap:16px}
.costing-workflow-dialog header h2 {margin:0;font-size:22px}
.costing-workflow-dialog [data-workflow-close] {width:36px;min-width:36px;padding:4px;font-size:24px}
.costing-workflow-dialog [data-workflow-error] {color:#ae2525;overflow-wrap:anywhere}
.costing-ledger-selection {max-height:45vh;overflow:auto;margin:16px 0;border:1px solid #d5e0ed;border-radius:8px}
.costing-ledger-selection label {display:flex;align-items:center;gap:12px;padding:12px;border-bottom:1px solid #e6edf6}
.costing-ledger-selection label[hidden] {display:none}
.costing-ledger-selection input[type="checkbox"] {width:20px;height:20px;min-height:20px;flex:0 0 20px;margin:0}
.costing-ledger-selection span {min-width:0;overflow-wrap:anywhere}
.costing-ledger-selection strong {display:block;margin-top:4px}
.costing-crop-stage {margin:14px 0;max-height:60vh;overflow:auto;background:#edf2f8;border:1px solid #b9cde7}
.costing-crop-stage canvas {display:block;width:100%;height:auto;touch-action:none;cursor:crosshair}
.costing-crop-actions,.costing-source-photos {display:flex;flex-wrap:wrap;gap:10px;margin:12px 0}
.costing-source-photos p {width:100%;margin:0}
.costing-workflow-dialog button {white-space:normal}

.costing-product-footer {gap:4px}
.costing-table .costing-product-footer .costing-split-photo {display:grid;place-items:center;flex:0 0 30px;width:30px;height:30px;min-height:30px;margin:0;padding:4px;background:#fff;color:#284e8b;border:1px solid #c7d6ec;border-radius:6px}
.costing-product-footer .costing-split-photo:hover {background:#edf3ff;border-color:#7fa3d8}
.costing-product-footer .costing-split-photo svg {pointer-events:none}

.costing-product-card {display:grid;grid-template-areas:"name" "photo" "footer";grid-template-rows:49px 100px 30px;gap:5px;height:auto;padding:5px;box-sizing:border-box}
.costing-table .costing-product-card .costing-product-name {position:static;grid-area:name;width:100%;margin:0;max-width:none}
.costing-table .costing-product-card .costing-product-image,.costing-product-card .costing-product-empty {grid-area:photo;width:100%;height:100%;min-height:0}
.costing-product-card .costing-product-image img {width:100%;height:100%;object-fit:contain}
.costing-product-card .costing-product-footer {position:static;grid-area:footer;width:100%;margin:0}
.crm-photo-details {display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:18px;margin-top:16px}
.crm-photo-media {min-width:0;overflow:auto;max-height:72vh;background:#edf2f7;border:1px solid #d2ddea;border-radius:8px}
.crm-photo-media img {display:block;width:100%;height:auto;max-height:68vh;object-fit:contain}
.crm-photo-media iframe {display:block;width:100%;height:68vh;border:0}
.crm-photo-zoom {display:flex;gap:8px;margin-top:12px}
.crm-photo-zoom button {min-width:40px;padding:6px 12px}
.crm-photo-details aside {min-width:0}
.crm-photo-details dl {display:grid;grid-template-columns:auto minmax(0,1fr);gap:6px 12px;font-size:13px}
.crm-photo-details dt {color:#5b6d84}
.crm-photo-details dd {margin:0;overflow-wrap:anywhere}
.crm-photo-details form {display:grid;gap:12px;margin-top:12px}
.crm-photo-details form label {display:grid;gap:6px}
.crm-photo-details textarea {min-height:140px;resize:vertical}
@media(max-width:800px){.crm-photo-details {grid-template-columns:1fr}.crm-photo-media {max-height:55vh}.crm-photo-media img {max-height:52vh}}

.crm-photo-media [hidden],.crm-photo-zoom[hidden] {display:none!important}

/* Readable figures with compact numeric controls. */
.costing-scroll {overflow-x:auto;max-height:none}
.costing-table {font-size:18px;min-width:1680px}
.costing-table td,.costing-table th {padding:8px 5px;line-height:1.35}
.costing-table .costing-zone-head th {font-size:17px;height:42px}
.costing-table .costing-column-head th {font-size:16px;line-height:1.3;height:108px}
.costing-table td[data-result] {font-size:18px;font-weight:600;white-space:nowrap;letter-spacing:0}
.costing-table input[type="number"] {width:100%;max-width:92px;min-height:38px;font-size:18px;padding:5px 4px}
.costing-table [data-cost-item="quantity"],.costing-table [data-cost-item="weight"] {max-width:60px}
.costing-table [data-cost-item="priceYuan"],.costing-table [data-cost-item="drop"],.costing-table [data-cost-item="retail"] {max-width:84px}
.costing-table .costing-column-head select {font-size:16px;min-height:36px;padding:4px}
.costing-row-actions button {font-size:16px;min-height:40px;padding:7px 5px;line-height:1.3}
.costing-product-card {grid-template-rows:54px 100px 34px}
.costing-table .costing-product-card .costing-product-name {font-size:18px;line-height:1.25;height:54px;min-height:54px}
.costing-table .costing-product-footer .costing-product-sku {font-size:16px;height:34px;min-height:34px;padding:4px}
.costing-compact-bulk label {font-size:16px}
.costing-compact-bulk input {font-size:18px}
.costing-compact-bulk button {font-size:15px}
.costing-summary span {font-size:16px}
.costing-summary strong {font-size:24px}

.costing-table [data-cost-zone="shipping"] input[type="number"],.costing-table [data-cost-zone="additional"] input[type="number"] {max-width:72px}

.costing-table tbody [data-cost-row] > td {background:#fff}
.costing-table tbody [data-cost-intake="accepted"] > td {background:#e2f3e6}
.costing-table tbody [data-cost-intake-section] > th {position:static;text-align:left;background:#fff;color:#334155;padding:12px 14px;border-top:2px solid #d4dce6;font-size:16px}
.costing-table tbody [data-cost-intake-section="accepted"] > th {background:#d2ead9;color:#205c35;border-top-color:#9ac9a8}
.costing-intake-button[aria-pressed="true"] {border-color:#8bbd9a;color:#205c35}

.costing-price-fields {display:grid;gap:10px}
.costing-price-fields label {display:grid;gap:4px;font-size:14px;line-height:1.2;color:#52627b;text-align:right}
.costing-price-fields input[type="number"] {max-width:92px;justify-self:end}
.costing-price-fields[data-cost-price-mode="unit"] label:first-child,.costing-price-fields[data-cost-price-mode="total"] label:last-child {color:#17477e;font-weight:700}
