/* Shared compact layout for the two new-order forms. */
#addSheet,
#enterpriseModal:has(.order-entry-dialog) {
  align-items: flex-end;
  padding: 16px max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
}
.sheet.order-entry-dialog,
.en-dialog.order-entry-dialog {
  --entry-control-height: 40px;
  display: flex;
  flex-direction: column;
  width: min(720px, 100%);
  max-height: calc(100dvh - 32px - env(safe-area-inset-bottom));
  padding: 16px 20px;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background: var(--surface-sheet);
  box-shadow: 0 28px 80px rgba(4, 32, 68, .22), inset 0 1px 0 var(--glass-line);
  overflow: hidden;
  overscroll-behavior: contain;
}
.order-entry-dialog .sheet-grabber { flex-shrink: 0; margin-bottom: 10px; }
.en-dialog.order-entry-dialog::before {
  content: "";
  position: static;
  inset: auto;
  display: block;
  flex: 0 0 5px;
  width: 47px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(28, 108, 171, .28);
  opacity: 1;
  box-shadow: none;
}
.order-entry-dialog .sheet-header,
.order-entry-dialog .en-dialog-head {
  flex: 0 0 auto;
  min-height: 34px;
  margin: 0 0 10px;
  padding: 0;
  border: 0;
}
.order-entry-dialog .sheet-header h2,
.order-entry-dialog .en-dialog-head h2 { font-size: 21px !important; line-height: 1.3; }
.order-entry-dialog .en-dialog-head .en-eyebrow { display: none; }
.order-entry-dialog .order-entry-heading { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.order-entry-dialog .order-entry-heading h2 { margin: 0; white-space: nowrap; }
.order-entry-dialog #dispatchCustomerEntryButton { flex: 0 0 auto; width: auto; min-height: 32px; padding: 6px 10px; border-radius: 10px; white-space: nowrap; }
.order-entry-dialog .en-dialog-head > .icon-button { flex: 0 0 34px; }
.order-entry-dialog :is(.sheet-header, .en-dialog-head) .icon-button { width: 34px; height: 34px; }
.en-dialog.order-entry-dialog > form.en-form,
.sheet.order-entry-dialog > .order-entry-form {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 0;
  overflow: hidden;
}
.order-entry-dialog .en-dialog-body,
.sheet.order-entry-dialog > .order-entry-form > .order-entry-grid {
  flex: 1 1 auto;
  min-height: 0;
  padding: 2px 6px 2px 2px;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--blue-300) transparent;
}
.order-entry-dialog .en-dialog-body {
  display: block;
}
.order-entry-dialog .en-dialog-body > .en-subtitle { margin: 0 0 8px !important; font-size: 12px; line-height: 1.5; }
.order-entry-dialog .en-dispatch-self-reminder { margin-bottom: 8px; padding: 8px 12px; }
@supports selector(::-webkit-scrollbar) {
  .order-entry-dialog .en-dialog-body,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid { scrollbar-width: auto; scrollbar-color: auto; }
  .order-entry-dialog .en-dialog-body::-webkit-scrollbar,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid::-webkit-scrollbar { width: 6px; height: 6px; }
  .order-entry-dialog .en-dialog-body::-webkit-scrollbar-track,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid::-webkit-scrollbar-track { margin-block: 8px; border-radius: 99px; background: var(--surface-tint); }
  .order-entry-dialog .en-dialog-body::-webkit-scrollbar-thumb,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid::-webkit-scrollbar-thumb { min-height: 36px; border-radius: 99px; background: var(--blue-300); }
  .order-entry-dialog .en-dialog-body::-webkit-scrollbar-thumb:hover,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid::-webkit-scrollbar-thumb:hover { background: var(--blue-500); }
  .order-entry-dialog .en-dialog-body::-webkit-scrollbar-button,
  .sheet.order-entry-dialog > .order-entry-form > .order-entry-grid::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
}
.order-entry-dialog .order-entry-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
  align-content: start;
}
.order-entry-grid > [data-order-entry-field] {
  display: flex;
  min-width: 0;
  grid-column: span 3;
  flex-direction: column;
  gap: 5px;
  margin: 0;
}
.order-entry-grid > [data-order-entry-field="assigneeId"] { grid-column: span 3; order: 0; }
.order-entry-grid > [data-order-entry-field="orderNo"] { grid-column: 1 / -1; order: 5; }
.order-entry-grid:has(> [data-order-entry-field="assigneeId"]) > [data-order-entry-field="orderNo"] { grid-column: span 3; }
.order-entry-grid > :is([data-order-entry-field="date"], [data-order-entry-field="occurredAt"], [data-order-entry-field="deadline"]) { order: 10; }
.order-entry-grid > :is([data-order-entry-field="shippedAt"], [data-order-entry-field="confirmedAt"]) { order: 15; }
.order-entry-grid > :is([data-order-entry-field="pages"], [data-order-entry-field="price"], [data-order-entry-field="total"]) { grid-column: span 2; order: 20; }
.order-entry-grid > :is([data-order-entry-field="receivedMode"], [data-order-entry-field="receivedPercent"], [data-order-entry-field="received"]) { grid-column: span 2; order: 30; }
.order-entry-grid > :is([data-order-entry-field="method"], [data-order-entry-field="source"]) { order: 40; }
.order-entry-grid > :is([data-order-entry-field="priority"], [data-order-entry-field="note"]) { order: 50; }
#recordForm [data-order-entry-field="note"] { grid-column: 1 / -1; }
.order-entry-grid:has([data-order-entry-field="receivedPercent"][hidden], [data-order-entry-field="receivedPercent"].is-hidden) > :is([data-order-entry-field="receivedMode"], [data-order-entry-field="received"]) { grid-column: span 3; }
.order-entry-grid > [data-order-entry-field="status"] {
  grid-column: 1 / -1;
  order: 60;
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  min-height: 26px;
  padding: 0;
}
.order-entry-grid [data-order-entry-field] > :is(label, span:first-child) { color: var(--blue-800); font-size: 12px; font-weight: 740; line-height: 16px; }
.order-entry-dialog :is(.glass-input, .en-input, .en-select-trigger, .entry-mode-button) {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  min-height: var(--entry-control-height);
  height: var(--entry-control-height);
  padding: 0 12px;
  border: 1px solid var(--glass-edge);
  border-radius: 13px;
  background: var(--surface-control);
  color: var(--blue-900);
  box-shadow: inset 0 1px 0 var(--glass-line);
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
}
.order-entry-dialog :is(.glass-input, .en-input, .en-select-trigger, .entry-mode-button):focus-visible { outline: 2px solid var(--blue-500); outline-offset: 1px; }
.order-entry-dialog :is(.entry-mode-button, .en-select-trigger) { gap: 6px; }
.order-entry-dialog .entry-mode-button span { font-size: 13px; }
.order-entry-dialog .en-select-trigger { font-weight: 720; }
/* Hidden form selects must not inherit control min-heights and create empty overflow. */
.order-entry-dialog select.en-native-select { min-height: 0 !important; }
.order-entry-dialog :is(input.is-calculated, input.en-calculated) { background: var(--surface-tint); color: var(--blue-700); }
.order-entry-dialog :is(.form-source-control input, .order-option-control > input[data-order-option]) { padding-right: 38px; }
.order-entry-dialog .entry-source-arrow { width: 36px; height: calc(var(--entry-control-height) - 2px); border-radius: 12px; }
.order-entry-dialog .order-option-arrow {
  top: 0;
  bottom: 0;
  right: 1px;
  width: 36px;
  height: calc(var(--entry-control-height) - 2px);
  margin-block: auto;
  transform: none !important;
  border-radius: 12px;
}
.order-entry-dialog .order-option-arrow:is(:hover, :active, .pressing) { transform: none !important; }
.order-entry-dialog .order-option-arrow > svg,
#enterpriseModal .order-entry-dialog .order-option-arrow > svg { width: 18px; height: 18px; flex: 0 0 18px; }
.order-entry-grid > .order-entry-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 10px 12px;
}
.order-entry-status > .en-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; margin: 0; }
.order-entry-status > .en-field > span { color: var(--blue-800); font-size: 12px; font-weight: 740; line-height: 16px; }
.order-entry-status > .order-entry-status-choice { grid-column: 1 / -1; }
.order-entry-status:has([data-entry-refund-field="mode"]:not([hidden])) > .order-entry-status-choice { grid-column: auto; }
.order-entry-status > [hidden] { display: none !important; }
.order-entry-refund-preview,
.order-entry-refund-permission { grid-column: 1 / -1; margin: 0; color: var(--blue-700); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.order-entry-refund-preview { padding: 9px 12px; border: 1px solid var(--glass-edge); border-radius: 12px; background: var(--surface-tint); }
.order-entry-dialog .en-member-combobox-input { padding-right: 50px; }
.order-entry-dialog input[data-date-picker] { padding-right: 31px; }
.order-entry-dialog .form-checks { gap: 16px; padding: 0; }
.order-entry-dialog .form-checks .check-wrap { font-size: 12px; }
.order-entry-dialog [data-order-entry-field="status"] .check-wrap { min-height: 38px; padding: 5px 10px 5px 6px; border-radius: 15px; background: rgba(255,255,255,.35); }
.order-entry-dialog [data-order-entry-field="status"] .check-wrap input { width: 1px; height: 1px; }
.order-entry-dialog [data-order-entry-field="status"] .check-wrap input:focus-visible + .check-ui { outline: 2px solid var(--blue-500); outline-offset: 2px; }
.order-entry-dialog .sheet-actions,
.order-entry-dialog .en-dialog-actions {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 1fr 1.25fr;
  gap: 12px;
  margin: 12px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.order-entry-dialog :is(.sheet-actions, .en-dialog-actions) > button {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--glass-edge);
  border-radius: 14px;
  font-size: 13px;
  font-weight: 750;
}
.order-entry-dialog .en-dialog-actions > .en-button:not(.primary) { color: var(--blue-800); background: var(--surface-control); box-shadow: inset 0 1px 0 var(--glass-line); }
.en-dialog.order-entry-dialog > form.en-form > .en-status:not(:empty) { padding: 10px 0 0; }
@media (max-width: 600px) {
  .order-entry-grid > :is([data-order-entry-field="shippedAt"], [data-order-entry-field="confirmedAt"]) { grid-column: 1 / -1; }
  .order-entry-grid > .order-entry-status { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-entry-status:has([data-entry-refund-field="mode"]:not([hidden])) > .order-entry-status-choice { grid-column: 1 / -1; }
}
@media (max-width: 600px), (max-height: 820px) {
  .sheet.order-entry-dialog, .en-dialog.order-entry-dialog { --entry-control-height: 36px; padding: 12px 16px 16px; border-radius: 24px; }
  .order-entry-dialog .sheet-grabber, .en-dialog.order-entry-dialog::before { margin-bottom: 8px; }
  .order-entry-dialog .sheet-header, .order-entry-dialog .en-dialog-head { margin-bottom: 10px; }
  .order-entry-dialog .sheet-header h2, .order-entry-dialog .en-dialog-head h2 { font-size: 19px !important; }
  .order-entry-dialog .order-entry-grid { gap: 9px 10px; }
  .order-entry-dialog .en-dialog-body > .en-subtitle { margin-bottom: 9px !important; font-size: 11px; }
  .order-entry-dialog :is(.sheet-actions, .en-dialog-actions) { gap: 10px; margin-top: 12px; }
  .order-entry-dialog :is(.sheet-actions, .en-dialog-actions) > button { min-height: 40px; padding-block: 8px; }
}
@media (max-width: 360px) {
  #addSheet, #enterpriseModal:has(.order-entry-dialog) { padding-inline: 8px; }
  .sheet.order-entry-dialog, .en-dialog.order-entry-dialog { padding-inline: 12px; }
  .order-entry-dialog .order-entry-grid { gap: 8px; }
  .order-entry-grid [data-order-entry-field] > :is(label, span:first-child) { font-size: 11px; }
  .order-entry-dialog :is(.glass-input, .en-input, .en-select-trigger, .entry-mode-button) { padding-inline: 9px; font-size: 12px; }
  .order-entry-dialog .entry-mode-button span { font-size: 12px; }
  .order-entry-dialog :is(.form-source-control input, .order-option-control > input[data-order-option]) { padding-right: 36px; }
  .order-entry-dialog .en-member-combobox-input { padding-right: 50px; }
  .order-entry-dialog input[data-date-picker] { padding-left: 7px; padding-right: 26px; font-size: 11px; letter-spacing: -.035em; }
  .order-entry-dialog .date-picker-field > svg.date-picker-icon,
  #enterpriseModal .order-entry-dialog .date-picker-field > svg.date-picker-icon { right: 8px; width: 13px; height: 13px; }
}
@media (max-height: 680px) {
  .order-entry-dialog .sheet-header, .order-entry-dialog .en-dialog-head { margin-bottom: 6px; }
  .order-entry-dialog .order-entry-grid { row-gap: 6px; }
  .order-entry-grid > [data-order-entry-field] { gap: 3px; }
  .order-entry-dialog :is(.sheet-actions, .en-dialog-actions) { margin-top: 8px; }
}
