/* tradepricing1: module-only geometry; Workspace retains drag/resize/back behavior. */
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) { min-height: 0; }
:is(#tradePricingContent, #tradeInvoicesContent, #tradeRetailContent, #tradeReceiptInvoicesContent, #tradeKsefContent, #tradeReportsContent) { height: 100%; min-height: 0; color: var(--color-text); }
html[data-crm-workspace="windows"] body.workspace-shell-enabled .main > :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports).workspace-window-open { display: flex; flex-direction: column; padding: 0; overflow: hidden; gap: 0; }
html[data-crm-workspace="windows"] body.workspace-shell-enabled :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) > .workspace-window-titlebar { flex: 0 0 auto; margin: 0; position: relative; top: auto; }
html[data-crm-workspace="windows"] body.workspace-shell-enabled :is(#tradePricingContent, #tradeInvoicesContent, #tradeRetailContent, #tradeReceiptInvoicesContent, #tradeKsefContent, #tradeReportsContent) { flex: 1 1 auto; height: auto; min-height: 0; overflow: hidden; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-shell { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--color-surface); border: 1px solid var(--color-accent-border); border-radius: var(--app-radius, 12px); overflow: hidden; }
html[data-crm-workspace="windows"] body.workspace-shell-enabled :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-shell { border: 0; border-radius: 0; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-header { display: flex; align-items: start; justify-content: space-between; gap: 10px; padding: 12px 14px 8px; flex: 0 0 auto; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) h2 { font-size: 17px; line-height: 1.3; margin: 0 0 4px; color: var(--color-text); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) h3 { font-size: 15px; margin: 0 0 6px; color: var(--color-text); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) h4 { font-size: 13px; margin: 8px 0; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) p { margin: 5px 0; overflow-wrap: anywhere; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-header p, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) small, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-note { color: var(--color-muted); font-size: 12px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 12px 14px; overscroll-behavior: contain; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-footer, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-footer { flex: 0 0 auto; border-top: 1px solid var(--color-border); background: var(--color-surface-soft); padding: 9px 14px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; margin: 0; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-card { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 11px; border: 1px solid var(--color-border); border-radius: var(--app-radius, 10px); background: var(--color-surface-soft); margin-bottom: 9px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-card > div:first-child { min-width: 0; flex: 1 1 250px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-money { display: block; font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) label { display: flex; flex-direction: column; gap: 5px; min-width: 0; font-size: 12px; font-weight: 600; margin: 7px 0; color: var(--color-text); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) input, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) select, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) textarea { box-sizing: border-box; width: 100%; min-width: 0; border: 1px solid var(--color-border); border-radius: var(--app-radius, 8px); padding: 8px; background: var(--color-input-bg); color: var(--color-text); font: inherit; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) input[readonly] { background: var(--color-input-readonly-bg); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-position { border: 1px solid var(--color-border); border-radius: var(--app-radius, 10px); padding: 9px 11px; min-width: 0; margin: 12px 0; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-position legend { font-size: 13px; font-weight: 700; padding: 0 5px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-check { flex-direction: row; align-items: start; gap: 9px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-check input { width: 19px; height: 19px; flex: 0 0 auto; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-message, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-pending, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-warning { padding: 9px 12px; border: 1px solid var(--color-accent-border); background: var(--color-accent-soft); color: var(--color-text); font-size: 13px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-message, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-pending { flex: 0 0 auto; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-message[hidden] { display: none; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-totals { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-totals dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-document { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--app-radius, 10px); padding: 14px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-table-wrap { overflow-x: auto; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) table { width: 100%; border-collapse: collapse; font-size: 12px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) th, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) td { padding: 8px 6px; border-bottom: 1px solid var(--color-border); text-align: left; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) button { cursor: pointer; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) button:disabled { opacity: .65; cursor: wait; }
body:not(.workspace-shell-enabled) :is(#tradePricingContent, #tradeInvoicesContent, #tradeRetailContent, #tradeReceiptInvoicesContent, #tradeKsefContent, #tradeReportsContent) { height: min(780px, calc(100dvh - 130px)); min-height: 360px; }
@media (max-width: 600px) {
  :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-header, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-body, :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-footer { padding-left: 10px; padding-right: 10px; }
  :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-footer button { min-height: 40px; }
  :is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-header p { font-size: 11px; }
}

:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-preview { border: 1px solid var(--color-accent-border); padding: 10px; margin: 12px 0; border-radius: var(--app-radius, 10px); background: var(--color-surface-soft); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-muted { color: var(--color-muted); }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-form-lock { margin: 0; padding: 0; min-width: 0; border: 0; }
:is(#tradePricing, #tradeInvoices, #tradeRetail, #tradeReceiptInvoices, #tradeKsef, #tradeReports) .ts-summary { display: flex; gap: 14px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }

/* traderetail1: multiline historical notes and shared document details. */
#tradeInvoices .ts-preserve,#tradeRetail .ts-preserve{white-space:pre-wrap;overflow-wrap:anywhere}
#tradeInvoices details.ts-position>summary,#tradeRetail details.ts-position>summary{cursor:pointer;font-weight:600}

#tradeRetail .ts-inline{display:flex;align-items:end;flex-wrap:wrap;gap:8px;margin:8px 0}#tradeRetail .ts-inline label{min-width:160px;flex:1}#tradeRetail .ts-inline button{flex:0 0 auto}

/* tradereports1: filter form stays inside the single scrolling content area. */
#tradeReports .tr-filters { display: block; flex: none; overflow: visible; margin: 0 0 14px; }
#tradeReports .ts-totals dd { overflow-wrap: anywhere; text-align: right; }
#tradeReports .ts-position summary { cursor: pointer; color: var(--color-text); font-weight: 600; }
#tradeReports .tr-basis { margin: 8px 0; font-size: 12px; color: var(--color-muted); }
@media (max-width: 600px) { #tradeReports .tr-filters .ts-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; } }
