.of-preview { box-sizing: border-box; width: min(1240px, calc(100vw - 32px)); height: min(900px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); }
.of-preview > form { height: 100%; min-height: 0; grid-template-rows: auto minmax(0, 1fr) auto; }
.of-preview .dialog-body { min-height: 0; overflow: auto; scrollbar-gutter: stable; background: #f5f7f6; }
.of-notice { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; color: #65756d; font-size: 11px; }
.of-notice span { padding: 5px 8px; border-radius: 5px; background: #f4ead3; color: #816127; font-size: 9px; letter-spacing: .07em; font-weight: 800; white-space: nowrap; }
.of-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px 16px; }
.of-preview label { display: grid; gap: 6px; color: #63756c; font-size: 11px; font-weight: 600; }
.of-preview input, .of-preview select, .of-preview textarea { box-sizing: border-box; width: 100%; min-width: 0; padding: 9px 10px; border: 1px solid #d8e1dc; border-radius: 6px; background: #fff; color: #233e32; font: inherit; font-size: 12px; }
.of-preview input:focus, .of-preview select:focus, .of-preview textarea:focus { outline: 2px solid #91b9a7; outline-offset: 1px; }
.of-preview input[readonly], .of-preview input:disabled, .of-preview select:disabled { background: #f0f3f1; color: #7e8d85; }
.of-identity { padding: 16px; border: 1px solid #d8e2dc; border-radius: 9px; background: #fff; }
.of-identity .of-grid { grid-template-columns: 1.1fr 2.5fr 1fr .7fr; }
.of-entity-field { min-width: 0; display: grid; gap: 6px; }
.of-entity-picker { display: flex; align-items: center; gap: 6px; }
.of-entity-picker input { flex: 1; }
.of-entity-picker button { flex-shrink: 0; padding: 9px 8px; }
.of-tabs { display: flex; gap: 24px; margin: 18px 0; border-bottom: 1px solid #dbe4de; }
.of-tabs button { display: flex; gap: 9px; padding: 12px 14px; border: 0; border-bottom: 2px solid transparent; border-radius: 6px 6px 0 0; background: transparent; color: #83948b; font: inherit; font-size: 11px; cursor: pointer; }
.of-tabs button span { font-weight: 700; }
.of-tabs [aria-selected="true"] { border-bottom-color: #263b34; background: #263b34; color: #fff; }
.of-tabs button:focus-visible { outline: 2px solid #91b9a7; outline-offset: 2px; }
.of-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; }
.of-columns > div { display: grid; align-content: start; gap: 16px; }
.of-card { padding: 17px; border: 1px solid #dfe6e1; border-radius: 9px; background: #fff; }
.of-card h3 { margin: 0 0 14px; color: #294d3d; font-size: 12px; }
.of-notes textarea { resize: vertical; }
.of-section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.of-section-heading h3 { margin-bottom: 6px; }
.of-section-heading p, .of-empty { color: #7a8981; font-size: 12px; }
.of-table-wrap { overflow: auto; }
.of-preview table { width: 100%; border-collapse: collapse; }
.of-preview th { padding: 10px 8px; color: #708378; background: #f1f5f2; font-size: 10px; text-align: left; white-space: nowrap; }
.of-preview td { padding: 8px 4px; border-bottom: 1px solid #e5ebe7; }
.of-preview td input { min-width: 75px; }
.of-preview td input[type="date"] { min-width: 130px; }
.of-preview td input[type="checkbox"] { min-width: 18px; accent-color: #244b3b; }
.of-empty { padding: 50px 10px; text-align: center; }
.of-size-settings { max-width: none; grid-template-columns: 220px minmax(0,1fr); grid-template-areas: "scale sizes"; align-items: start; margin-bottom: 20px; }
.of-size-settings > label:first-child { grid-area: scale; }
.of-size-settings > label { grid-template-rows: auto 40px; align-content: start; }
.of-size-settings > label > input, .of-size-settings > label > select { box-sizing: border-box; height: 40px; min-height: 40px; }
.of-size-settings > .of-size-scale-preview { grid-area: sizes; align-self: end; align-content: center; min-height: 40px; margin: 0; }
@media (max-width: 800px) {
  .of-size-settings { grid-template-columns: minmax(0,1fr); grid-template-areas: "scale" "sizes"; }
}
.of-preview [data-sizes] input[aria-label="Descrição da cor"] { min-width: 220px; }
.of-recalculate-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 16px; margin-bottom: 8px; }
.of-recalculate-controls > label:not(.of-round-plan) { flex: 0 0 120px; grid-template-rows: auto 40px; }
.of-recalculate-controls > label:not(.of-round-plan) input { height: 40px; }
.of-recalculate-controls > button { min-height: 40px; }
.of-recalculate-controls .of-round-plan { display: flex; align-items: center; gap: 8px; padding-bottom: 10px; }
.of-round-plan input[type="checkbox"] { width: auto; accent-color: #263b34; }
.of-calculation-hint { font-size: 11px; color: #708378; margin-bottom: 20px; }
.of-calculated { margin-top: 24px; border-top: 1px solid #dfe6e1; padding-top: 20px; }
.of-calculated [role="status"] { font-size: 12px; color: #294d3d; }
.of-total { display: flex; justify-content: flex-end; align-items: center; gap: 24px; padding-top: 24px; color: #74877b; font-size: 12px; }
.of-total strong { color: #244b3b; font-size: 22px; }
.of-remove { border: 0; background: transparent; color: #a35c54; font-size: 22px; cursor: pointer; }
.of-feedback { color: #708378; font-size: 11px; }
.of-preview > form > footer { flex-wrap: wrap; }
.of-preview > form > header { flex-wrap: wrap; }
.of-header-tools { display: flex; flex-wrap: wrap; gap: 8px; flex-basis: 100%; padding-top: 12px; border-top: 1px solid #ffffff30; }
.of-header-tool { display: flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #d8e2dc; border-radius: 6px; background: #fff; color: #263b34; font: inherit; font-size: 11px; cursor: pointer; }
.of-header-tool svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.of-header-tool:hover { background: #edf3ef; border-color: #91b9a7; }
.of-header-tool:focus-visible { outline: 2px solid #91b9a7; outline-offset: 2px; }
.of-import-trigger:disabled { opacity: .45; cursor: not-allowed; background: #f0f3f1; border-color: #d8e2dc; }
.of-actions { position: relative; }
.of-actions-menu { position: absolute; bottom: calc(100% + 8px); left: 0; z-index: 2; width: 210px; padding: 6px; border: 1px solid #d8e2dc; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #17352826; }
.of-actions-menu button { display: block; width: 100%; padding: 10px 12px; border: 0; border-radius: 5px; background: transparent; color: #294d3d; font: inherit; font-size: 12px; text-align: left; cursor: pointer; }
.of-actions-menu button:hover, .of-actions-menu button:focus-visible { background: #edf3ef; outline: 2px solid #91b9a7; outline-offset: -2px; }
.of-related-dialog { width: min(1000px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); }
.of-related-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.of-related-dialog .dialog-body { min-height: 0; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.of-related-dialog .dialog-body > * { flex: 0 0 auto; }
.of-related-dialog .of-related-table { flex: 1 1 auto; min-height: 120px; max-height: none; }
.of-related-table { overflow: auto; }
.of-related-dialog table { width: 100%; border-collapse: collapse; }
.of-related-dialog th, .of-related-dialog td { padding: 12px; border-bottom: 1px solid #dfe6e1; text-align: left; font-size: 12px; }
.of-related-dialog th { background: #f1f5f2; color: #294d3d; white-space: nowrap; }
.of-related-dialog .of-related-empty { padding: 48px 12px; text-align: center; color: #708378; }
.of-related-dialog [role="status"] { color: #708378; font-size: 12px; }
.of-related-caption { text-align: left; padding-bottom: 12px; color: #63756c; font-size: 12px; }
.of-related-dialog::backdrop { background: #0006; }
.of-preview [hidden] { display: none !important; }
@media (max-width: 800px) { .of-identity .of-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } .of-columns { grid-template-columns: 1fr; } .of-tabs { gap: 12px; } .of-notice { align-items: flex-start; } .of-preview footer { flex-wrap: wrap; } .of-feedback { width: 100%; } }

.of-preview [data-operations] select { min-width: 220px; }
.of-operation-loader { display: flex; align-items: end; gap: 12px; flex-wrap: wrap; }
.of-operation-loader > label { width: 110px; }
.of-load-product { flex: 1; min-width: 250px; display: grid; gap: 6px; }
.of-operation-loader .of-product-picker { min-width: 0; }
.of-operation-loader .of-product-picker input { flex: 1; }
.of-operation-loader .of-product-picker button { flex-shrink: 0; }
[data-load-status] { font-size: 12px; color: #63756c; }

.of-product-picker { display: flex; align-items: center; gap: 6px; min-width: 320px; }
.of-product-search { box-sizing: border-box; width: min(850px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 40px)); max-height: calc(100dvh - 40px); }
.of-product-search[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; }
.of-product-search .dialog-body { display: grid; grid-template-rows: auto auto minmax(0, 1fr); min-height: 0; overflow: hidden; }
.of-product-search form { display: flex; align-items: end; gap: 12px; height: auto; }
.of-product-search label { display: grid; gap: 6px; flex: 1; }
.of-product-search input { box-sizing: border-box; width: 100%; padding: 10px; }
.of-product-results { min-height: 0; overflow: auto; scrollbar-gutter: stable; }
.of-product-search table { width: 100%; border-collapse: collapse; }
.of-product-search th, .of-product-search td { padding: 9px; text-align: left; border-bottom: 1px solid #dfe6e1; overflow-wrap: anywhere; }
.of-product-search footer { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.of-product-search::backdrop { background: #0006; }
.of-operation-sizes { box-sizing: border-box; width: min(1050px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); }
.of-operation-sizes form { display: flex; flex-direction: column; max-height: calc(100dvh - 44px); }
.of-operation-sizes .dialog-body { overflow: auto; }
.of-operation-sizes label { display: grid; gap: 6px; }
.of-operation-sizes input, .of-operation-sizes select { box-sizing: border-box; padding: 8px; width: 100%; }
.of-operation-sizes table { border-collapse: collapse; width: 100%; min-width: 780px; }
.of-operation-sizes th, .of-operation-sizes td { padding: 4px; text-align: left; }
.of-operation-sizes td input { min-width: 64px; }
.of-operation-color { display: grid; grid-template-columns: minmax(0, 250px); margin: 16px 0; }
.of-operation-sizes footer { display: flex; gap: 10px; align-items: center; }
.of-operation-sizes::backdrop { background: #0006; }

/* Keep article codes and quantities compact in the operations table. */
.of-preview #ofPanelOperations th:nth-child(2),
.of-preview [data-operations] td:nth-child(2) { width: 240px; }
.of-preview #ofPanelOperations th:nth-child(3),
.of-preview [data-operations] td:nth-child(3) { width: 88px; }
.of-preview [data-operations] input[aria-label="Quantidade"] { box-sizing: border-box; width: 88px; min-width: 88px; text-align: right; }
.of-preview [data-operations] .of-product-picker { width: 240px; min-width: 240px; }
.of-preview [data-operations] .of-product-picker input { flex: 1; width: 0; min-width: 0; }
.of-preview [data-operations] .of-product-picker button { flex-shrink: 0; }

.of-operation-context-menu { position: fixed; inset: auto; margin: 0; padding: 5px; border: 1px solid #c8d5d0; border-radius: 8px; background: #fff; box-shadow: 0 8px 24px #162b2430; }
.of-operation-context-menu button { padding: 10px 16px; border: 0; border-radius: 5px; background: #fff; color: #203a32; font: inherit; cursor: pointer; }
.of-operation-context-menu button:hover, .of-operation-context-menu button:focus-visible { background: #edf3ef; }
.of-operation-context-menu button:disabled { opacity: .5; cursor: default; }
