.sheet-row-actions { display: flex; align-items: center; justify-content: center; gap: 4px; }
.order-filters__actions:empty { display: none; }
.client-publication-status { display: inline-block; font-size: var(--text-meta); line-height: 1.4; white-space: nowrap; color: var(--muted); }
.client-publication-status[data-state="changed"], .client-publication-status[data-state="unpublished"] { color: var(--amber); }
.client-publication-status[data-state="changed"]::before, .client-publication-status[data-state="unpublished"]::before { content: ""; display: inline-block; width: 5px; height: 5px; margin: 0 5px 2px 0; background: currentColor; border-radius: 50%; }
.sheet-input--fabricator-id { min-width: 210px; }
.hero-actions > a:not(.button) { font-size: var(--text-dense); }
.fabricators-page { max-width: 1120px; }
.fabricator-card { margin: var(--space-6) 0; padding: var(--space-6); border: 1px solid var(--line); border-radius: var(--radius-panel); background: var(--surface); }
.fabricator-form .form-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fabricator-form > .button { margin-top: 16px; }
.fabricator-card > form + form { margin-top: 14px; }
.fabricators-archived { margin-top: var(--space-6); }
.fabricators-archived li { margin: 10px 0; }
.publication-changes { margin-top: 18px; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-panel); }
.publication-changes-table { width: 100%; table-layout: fixed; border-collapse: collapse; background: var(--surface); font-size: var(--text-ui); }
.publication-changes-table th, .publication-changes-table td { padding: 15px 18px; text-align: left; vertical-align: top; overflow-wrap: anywhere; border-bottom: 1px solid var(--line); }
.publication-changes-table th:first-child { width: 22%; }
.publication-changes-table thead th { background: var(--table-header); font-size: var(--text-meta); }
.publication-changes-table tbody th { font-size: var(--text-dense); font-weight: 500; }
.publication-changes-table tbody td { line-height: 1.55; }
.publication-changes-table tr:last-child > * { border-bottom: 0; }
.publication-changes-table td:nth-child(2) { color: var(--muted); }
.publication-changes-table td:nth-child(3) { background: var(--accent-wash); }
.publication-changes-table img { display: block; width: 100%; max-width: 240px; max-height: 220px; object-fit: contain; margin: 8px 0; }
.publication-change-photos { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.publication-changes-table .publication-change-photo { width: min(100%, 180px); height: 150px; margin: 0; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-panel); }
.publication-review-page > .form-actions { align-items: center; margin-bottom: 38px; }
.publication-preview { margin-top: 38px; }
.publication-preview__page { margin-top: 20px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-panel); }
.publication-preview__page .client-status { padding: 28px 36px; }
.publication-preview__page .client-product-photo__image { height: 380px; }
.work-order-document > .button { margin-top: var(--space-3); }
.work-order-history > li > .section-description { display: block; margin-top: var(--space-2); }
.work-order-history { list-style: none; padding: 0; margin: 14px 0; }
.work-order-history > li { padding: 16px 0; border-top: 1px solid var(--line); overflow-wrap: anywhere; }
.work-order-history .button { margin-top: 10px; }
.work-order-email-body { margin: 22px 0; padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); overflow-wrap: anywhere; }
.work-order-email-body p + p { margin-top: var(--space-4); }
.work-order-email-form { display: grid; gap: var(--space-4); }
.work-order-email-form .field-hint { margin: 0; }
.work-order-email-form > .button { justify-self: start; }
.work-order-edit-message { margin-top: var(--space-6); }
.work-order-edit-message .button { margin-top: var(--space-4); }
.work-order-edit-message[open] summary { margin-bottom: 14px; }
@media (max-width: 700px) {
  .fabricator-form .form-grid { grid-template-columns: 1fr; }
  .fabricator-card { padding: 16px; }
  .publication-changes-table { min-width: 550px; }
  .publication-preview__page .client-status { padding: 24px; }
  .publication-preview__page .client-product-photo__image { height: 320px; }
}

/* Working controls retain Bureau Sans beneath the shared display titles. */
.production-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 24px; margin-bottom: 18px; }
.production-tools > .order-filters { flex: 1 1 500px; padding: 0; }
.sheet-edit-hint { position: sticky; left: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--paper); color: var(--muted); font-size: var(--text-meta); }
.published-link { max-width: 760px; }
.order-row--late :is(.sheet-input--due-date, .sheet-input--promised-date) { color: var(--red-ink); background: var(--red-wash); }
.order-row--at_risk :is(.sheet-input--due-date, .sheet-input--promised-date) { color: var(--amber); background: var(--amber-wash); }
.order-table .order-row--late > td:first-child { box-shadow: inset 3px 0 var(--red), inset 0 -1px var(--line-soft); }
.order-table .order-row--at_risk > td:first-child { box-shadow: inset 3px 0 var(--amber), inset 0 -1px var(--line-soft); }
.order-row--late .sheet-input--order-number { color: var(--red-ink); }
.order-row--at_risk .sheet-input--order-number { color: var(--amber); }
.publication-diff { margin: 24px 0; border-block: 1px solid var(--line); padding: 16px 0; }
.publication-diff > summary { cursor: pointer; font-size: var(--text-ui); }
.sheet-risk-label--late { color: var(--red-ink); }
.sheet-risk-label--at_risk { color: var(--amber); }
.order-row--late .sheet-risk-label { color: var(--red-ink); }
.order-row--at_risk .sheet-risk-label { color: var(--amber); }
@media (max-width: 700px) {
  .order-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-filters .filter-field { width: auto; min-width: 0; }
  .order-filters .filter-field--search, .order-filters__actions { grid-column: 1 / -1; }
}

/* Hidden columns and production filters keep their existing placement. */
.column-popover__restore { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); font-size: var(--text-dense); }
.column-popover__restore summary { min-height: var(--control-height); margin-inline: -12px; padding: 8px 12px; cursor: pointer; }
.column-popover__restore summary:hover { color: var(--accent-hover); }
.column-popover__restore summary:active { color: var(--accent-active); }
.column-popover__restore summary:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.column-popover__restore summary span { color: var(--muted); margin-left: 5px; }
.column-popover__restore ul { list-style: none; margin: 12px 0 0; padding: 0; }
.column-popover__restore li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.order-filters { position: relative; flex-wrap: wrap; gap: 12px; }
.order-filters > .filter-field--search { min-width: 200px; }
@media (max-width: 700px) {
  .order-filters { grid-template-columns: minmax(0, 1fr) auto auto; align-items: end; gap: 10px; }
  .order-filters .filter-field--search { grid-column: 1 / -1; min-width: 0; }
  .order-filters .filter-field > .field-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); border: 0; }
}

/* Let data columns use the mobile viewport while record actions remain reachable. */
@media (max-width: 760px) {
  .sheet-row-actions { padding-inline: 4px; }
}

/* Detail lists share Production's columns and right-hand View action. */
.order-table--detail td:not(.sheet-cell--actions) { min-width: 140px; max-width: 300px; white-space: normal; overflow-wrap: anywhere; }
.order-table--detail .sheet-cell--date { min-width: 150px; white-space: nowrap; }
.order-table--detail :is(.sheet-cell--date, .sheet-cell--number) { font-variant-numeric: tabular-nums; }
.order-table--detail td.sheet-cell--actions, .order-table--detail th.sheet-actions-heading { width: 132px; min-width: 132px; }
.order-table--actions-only .sheet-row-actions { justify-content: flex-start; gap: 16px; }
@media (max-width: 760px) {
  .order-table--detail td.sheet-cell--actions, .order-table--detail th.sheet-actions-heading { width: 104px; min-width: 104px; }
}

/* Production column placement; density and editing states live in grid.css. */
.order-sheet { max-height: 70vh; }
.order-table { min-width: 1100px; }
.order-table--actions-only { min-width: 0; }
#order-sheet .sheet-input { min-width: 160px; }
#order-sheet .grid-checkbox > .sheet-input[type="checkbox"] { min-width: 16px; }
#order-sheet :is(th, td)[data-column-key="order_number"] { width: 154px; min-width: 154px; }
#order-sheet .sheet-input--order-number { min-width: 154px; font-family: var(--mono); }
#order-sheet :is(th, td)[data-column-key="product"] { width: 250px; min-width: 250px; }
#order-sheet .sheet-input--product { min-width: 250px; font-weight: 600; }
#order-sheet :is(th, td)[data-column-key="client_name"], #order-sheet :is(th, td)[data-column-key="stage"] { width: 190px; min-width: 190px; }
#order-sheet .sheet-input--client-name, #order-sheet .sheet-input--stage { min-width: 190px; }
#order-sheet .sheet-input--client-name { font-weight: 600; }
#order-sheet .sheet-input--stage { color: var(--accent); font-weight: 600; }
#order-sheet .sheet-input--quantity { min-width: 80px; }
#order-sheet .sheet-input--item-id { font-family: var(--mono); }
.order-table--detail [data-column-key="product"] { min-width: 250px; white-space: normal; overflow-wrap: anywhere; }
.production-view-controls { display: flex; gap: 4px; flex: 0 0 auto; }
.production-view-controls span { font-family: var(--mono); font-size: var(--text-meta); }
.production-stages { flex-wrap: wrap; }
.grid-cell__read { display: none; }
[data-grid-ready="true"] .grid-cell__read { display: block; min-height: var(--row-height); padding: 8px 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-grid-ready="true"] [data-production-grid-target="cell"]:not([data-grid-editing="true"]) > :is(.sheet-input, .grid-checkbox, .cell-name) { display: none; }
[data-grid-ready="true"] [data-grid-editing="true"] > .grid-cell__read { display: none; }
#order-sheet [data-production-grid-target="cell"] { cursor: cell; }
#order-sheet [data-grid-selected="true"] { background: var(--accent-wash); }
#order-sheet [data-grid-active="true"]:not([data-grid-editing="true"]) { outline: 2px solid var(--accent); outline-offset: -2px; }
#order-sheet .sheet-cell:has(> .row-drag-handle) > .grid-cell__read { padding-left: calc(var(--control-height) + 12px); }
#order-sheet [data-column-key="order_number"] .grid-cell__read { font-family: var(--mono); font-size: var(--text-meta); }
#order-sheet [data-column-key="product"] .grid-cell__read { width: 250px; font-weight: 600; }
#order-sheet .sheet-cell--text { min-width: 160px; }
#order-sheet .sheet-cell--date { min-width: 150px; }
#order-sheet .sheet-cell--number { min-width: 80px; }
#order-sheet .sheet-cell--text:not([data-column-key="order_number"]):not([data-column-key="item_id"]) .grid-cell__read { white-space: pre-wrap; overflow-wrap: anywhere; }
#order-sheet textarea.sheet-input--product { width: 250px; min-height: var(--row-height); max-height: 300px; resize: none; overflow-y: auto; white-space: pre-wrap; }
#order-sheet [data-production-grid-target="cell"]:not([data-grid-editing="true"]):has([data-client-draft="true"]) { box-shadow: inset 0 -2px var(--accent); }
#order-sheet [data-production-grid-target="cell"]:has([aria-invalid="true"]) { background: var(--red-wash); }
@media (max-width: 760px) {
  .production-view-controls { width: 100%; }
}

.column-library { margin-bottom: 12px; }
#order-sheet [data-column-key="client_name"] .grid-cell__read, #order-sheet [data-column-key="stage"] .grid-cell__read { font-weight: 600; }
#order-sheet [data-column-key="stage"] .grid-cell__read { color: var(--accent); }
#order-sheet .order-row--late [data-column-key="order_number"] .grid-cell__read { color: var(--red-ink); }
#order-sheet .order-row--at_risk [data-column-key="order_number"] .grid-cell__read { color: var(--amber); }
#order-sheet .order-row--late :is([data-column-key="due_date"], [data-column-key="promised_date"]) .grid-cell__read { color: var(--red-ink); background: var(--red-wash); }
#order-sheet .order-row--at_risk :is([data-column-key="due_date"], [data-column-key="promised_date"]) .grid-cell__read { color: var(--amber); background: var(--amber-wash); }
@media (max-width: 760px) {
  #order-sheet :is(th, td)[data-column-key="product"],
  #order-sheet .sheet-input--product,
  #order-sheet [data-column-key="product"] .grid-cell__read,
  #order-sheet textarea.sheet-input--product { width: 240px; min-width: 240px; }
}
#order-sheet [data-grid-editing="true"] { overflow: visible; outline: none; }

/* The grid read layer owns truncation; the upstream full-name tooltip remains
   available while editing without painting a second overlapping preview. */
[data-grid-ready="true"] .cell-name__preview { display: none; }
[data-grid-ready="true"] .cell-name .sheet-input { color: var(--ink); }
