.orders-hub {
  --orders-hub-sales-highlight: #fff59d;
  --orders-hub-sales-marker: #d4a900;
  --orders-hub-sales-ink: #0f172a;
  max-width: 1440px;
  min-width: 0;
  margin-inline: auto;
}
.orders-hub [hidden] {
  display: none !important;
}
.home-orders-widget a.metric {
  color: inherit;
  text-decoration: none;
}
.home-orders-widget a.metric:hover {
  border-color: var(--accent, #7c3aed);
  background: color-mix(
    in srgb,
    var(--surface, #fff) 96%,
    var(--accent, #7c3aed) 4%
  );
}
.home-orders-widget a.metric:focus-visible {
  outline: 2px solid var(--accent, #7c3aed);
  outline-offset: 3px;
}
.orders-hub-tabs,
.orders-hub-client-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.orders-hub-tabs [aria-pressed="true"] {
  color: var(--text, #0f172a);
  border-color: var(--accent, #7c3aed);
  background: color-mix(
    in srgb,
    var(--surface, #fff) 88%,
    var(--accent, #7c3aed) 12%
  );
  box-shadow: inset 0 -3px var(--accent, #7c3aed);
  font-weight: 700;
}
.orders-hub .card {
  margin-bottom: 16px;
  min-width: 0;
}
.orders-hub [data-production-amendment] fieldset {
  min-inline-size: 0;
  margin-inline: 0;
}
.orders-hub .form-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
}
.orders-hub .orders-hub-wide {
  grid-column: 1 / -1;
}
.orders-hub :is(input, select, textarea, button) {
  max-width: 100%;
  min-width: 0;
}
.orders-hub label {
  display: grid;
  gap: 8px;
}
.orders-hub textarea {
  min-height: 80px;
}
.orders-hub select {
  overflow: hidden;
  text-overflow: ellipsis;
}
.orders-hub label.orders-hub-check {
  display: flex;
  align-items: start;
}
.orders-hub .orders-hub-check input {
  width: auto;
  flex: none;
  margin-top: 4px;
}
.orders-hub button {
  min-height: 44px;
  white-space: normal;
}
.orders-hub-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.orders-hub-facts dt {
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 16px;
}
.orders-hub-facts dd {
  margin: 4px 0 0;
}
.orders-hub-table {
  overflow-x: auto;
  max-width: 100%;
}
.orders-hub-table table {
  width: 100%;
}
.orders-hub-table :is(th, td) {
  padding: 12px;
  text-align: left;
  vertical-align: top;
}
.orders-hub-table tr.orders-hub-monthly-sale > td {
  background: var(--orders-hub-sales-highlight);
  color: var(--orders-hub-sales-ink);
}
.orders-hub-table tr.orders-hub-monthly-sale > td:first-child {
  border-inline-start: 3px solid var(--orders-hub-sales-marker);
}
.orders-hub-table .orders-hub-number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.orders-hub :is(p, dd, pre, li, h3, label) {
  overflow-wrap: anywhere;
}
.orders-hub pre {
  white-space: pre-wrap;
  font-size: 12px;
}
.orders-hub-history {
  padding-left: 24px;
}
.orders-hub details {
  margin-top: 16px;
}
.orders-hub details > form {
  margin-top: 16px;
}
.orders-hub :focus-visible {
  outline: 2px solid var(--accent, #7c3aed);
  outline-offset: 3px;
}
@media (max-width: 767px) {
  .orders-hub .form-grid,
  .orders-hub-facts {
    grid-template-columns: minmax(0, 1fr);
  }
  .orders-hub .card {
    padding: 12px;
  }
}

.orders-hub-mobile-label {
  display: none;
}
@media (max-width: 767px) {
  .orders-hub
    :is([data-level-form], [data-buyer-price-form])
    .orders-hub-table
    :is(table, tbody, tr, td) {
    display: block;
    width: 100%;
  }
  .orders-hub
    :is([data-level-form], [data-buyer-price-form])
    .orders-hub-table
    thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .orders-hub
    :is([data-level-form], [data-buyer-price-form])
    .orders-hub-table
    tr {
    margin-block: 16px;
    border-block-end: 1px solid var(--line, #dfe5ef);
  }
  .orders-hub .orders-hub-mobile-label {
    display: block;
    color: var(--muted, #64748b);
    font-size: 12px;
    line-height: 16px;
  }
}

/* Workbook rows keep their cells and drafts mounted while sheets change. */
.orders-hub-sheets {
  display: flex;
  gap: 4px;
  max-width: 100%;
  overflow-x: auto;
  padding-block: 8px;
  border-block-end: 1px solid var(--line, #dfe5ef);
}
.orders-hub-sheets button {
  flex: 0 0 auto;
  white-space: nowrap;
}
.orders-hub-sheets [aria-pressed="true"] {
  border-color: var(--accent, #7c3aed);
  box-shadow: inset 0 -3px var(--accent, #7c3aed);
  font-weight: 700;
}
.orders-hub .orders-hub-workbook .orders-hub-table {
  position: relative;
  max-height: 65vh;
  border: 1px solid var(--line, #dfe5ef);
  margin-block: 12px;
}
.orders-hub .orders-hub-workbook .orders-hub-table table {
  display: table;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 14px;
  line-height: 20px;
}
.orders-hub .orders-hub-workbook[data-price-draft] table {
  min-width: 1200px;
}
.orders-hub .orders-hub-workbook .orders-hub-table thead {
  position: sticky;
  top: 0;
  z-index: 1;
  display: table-header-group;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
}
.orders-hub .orders-hub-workbook .orders-hub-table tbody {
  display: table-row-group;
}
.orders-hub .orders-hub-workbook .orders-hub-table tr {
  display: table-row;
  margin: 0;
}
.orders-hub .orders-hub-workbook .orders-hub-table :is(th, td) {
  display: table-cell;
  width: auto;
  padding: 4px 8px;
  vertical-align: middle;
  border-inline-end: 1px solid var(--line, #dfe5ef);
  border-block-end: 1px solid var(--line, #dfe5ef);
  background: var(--surface, #fff);
}
.orders-hub .orders-hub-workbook .orders-hub-table th {
  padding-block: 8px;
  white-space: nowrap;
  background: var(--card-bg, #fff);
}
.orders-hub .orders-hub-workbook tr.orders-hub-monthly-sale > td {
  background: var(--orders-hub-sales-highlight);
  color: var(--orders-hub-sales-ink);
}
.orders-hub-workbook td > label {
  margin: 0;
}
.orders-hub [data-cost-form] > label:first-of-type {
  max-width: 360px;
}
.orders-hub-unlisted > h2 {
  margin-bottom: 8px;
}
.orders-hub-unlisted td small {
  display: block;
  font-size: 12px;
  color: var(--muted, #64748b);
}
.orders-hub-unlisted [data-unlisted-detail] {
  white-space: normal;
  margin-block: 16px;
  padding-block: 12px;
  border-top: 1px solid var(--line, #dfe5ef);
}
.orders-hub-unlisted [data-unlisted-editor] {
  max-width: 880px;
}
.orders-hub-unlisted [data-unlisted-editor] > details {
  border-top: 1px solid var(--line, #dfe5ef);
  padding-block: 12px;
}
.orders-hub-unlisted [data-unlisted-editor] > details > summary {
  cursor: pointer;
  font-weight: 600;
  min-height: 32px;
}
.orders-hub-unlisted [data-unlisted-action] {
  margin-block: 12px;
}
.orders-hub-unlisted .orders-hub-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}
.orders-hub [data-cost-form] td label {
  font-size: 0;
  line-height: 0;
  gap: 0;
}
.orders-hub [data-cost-form] td small {
  display: block;
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 16px;
  margin-block-start: 4px;
}
.orders-hub [data-cost-form] td input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.orders-hub [data-cost-form] td:first-child {
  min-width: 200px;
}
.orders-hub [data-cost-form] td:nth-child(2) {
  min-width: 220px;
}
.orders-hub [data-cost-form] td:nth-child(3) {
  min-width: 180px;
}
.orders-hub-workbook td > label:not(.orders-hub-check) {
  font-size: 0;
  line-height: 0;
  gap: 0;
}
.orders-hub-workbook td :is(input, select) {
  font-size: 14px;
  line-height: 20px;
  min-height: 32px;
  height: 32px;
  padding: 4px 8px;
}
.orders-hub-workbook td input[type="number"] {
  width: 112px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.orders-hub-workbook td :is(small, .orders-hub-row-name) {
  display: block;
}
.orders-hub-workbook td small {
  font-size: 12px;
  line-height: 16px;
  color: var(--muted, #64748b);
}
.orders-hub-workbook [data-metadata-editor] {
  min-width: 240px;
  padding-block: 8px;
}
.orders-hub .orders-hub-workbook td button {
  min-height: 32px;
  padding: 4px 8px;
}
.orders-hub-workbook [data-price-error]:empty {
  display: none;
}
.orders-hub-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 767px) {
  .orders-hub .orders-hub-workbook td :is(input, select, button) {
    min-height: 44px;
  }
}
.orders-hub-sheets button,
.orders-hub .orders-hub-workbook td button {
  background: var(--surface, #fff);
  color: var(--text, #0f172a);
  border: 1px solid var(--line, #dfe5ef);
}
.orders-hub-sheets [aria-pressed="true"] {
  background: color-mix(
    in srgb,
    var(--accent, #7c3aed) 10%,
    var(--surface, #fff)
  );
}
.orders-hub .orders-hub-workbook[data-price-draft] td:first-child {
  position: relative;
  min-width: 220px;
  max-width: 280px;
  padding-inline-end: 48px;
}
.orders-hub-workbook .orders-hub-row-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.orders-hub .orders-hub-workbook [data-edit-metadata] {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 36px;
}
.orders-hub .orders-hub-workbook td [data-metadata-editor] {
  white-space: normal;
}
.orders-hub .orders-hub-workbook,
.orders-hub [data-add-sheet-host] {
  min-width: 0;
  max-width: 100%;
}

.orders-hub .orders-hub-schedule-days {
  min-width: 0;
  border: 1px solid var(--border, #dbe2ec);
  border-radius: 8px;
  padding: 8px;
}
.orders-hub-schedule-days > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.orders-hub-schedule-days label.orders-hub-check {
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 4px 8px;
  border: 1px solid var(--border, #dbe2ec);
  border-radius: 6px;
}
.orders-hub-schedule-days label.orders-hub-check input {
  margin: 0;
}

.orders-hub-catalog-photo {
  display: block;
  max-width: 100%;
  width: 360px;
  height: 240px;
  object-fit: contain;
}

.orders-hub [data-profit-settings] {
  display: grid;
  gap: 12px;
  min-width: 0;
}
.orders-hub [data-profit-policy] {
  min-inline-size: 0;
  max-width: 100%;
  margin: 0;
}
.orders-hub [data-policy-fields] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
}
.orders-hub [data-policy-fields] > label {
  min-width: 0;
}
@media (max-width: 767px) {
  .orders-hub [data-policy-fields] {
    grid-template-columns: minmax(0, 1fr);
  }
}

.orders-hub-cost-breakdown {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  min-width: 0;
}
.orders-hub-cost-breakdown details {
  min-width: 0;
}
.orders-hub-cost-breakdown details details {
  margin: 8px 0 8px 12px;
}
