/* Live patch for /orders period picker. */
.ordersOriginalDateWrap {
  display: none !important;
}

.ordersPeriodLive {
  flex: 1.35 1 240px;
  min-width: 240px;
}

.ordersPeriodLive .adminSortMenu {
  display: none;
  gap: 10px;
  padding: 12px;
  max-height: 360px;
  overflow: auto;
}

.ordersPeriodLive.open .adminSortMenu {
  display: grid;
}

.ordersPeriodMonths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.ordersPeriodMonths button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: #dfe8f7;
  font-weight: 800;
  text-align: left;
  text-transform: capitalize;
}

.ordersPeriodMonths button:hover {
  background: rgba(143, 239, 255, 0.12);
  color: #fff;
}

.ordersPeriodMonths button.active {
  border-color: rgba(143, 239, 255, 0.55);
  background: rgba(143, 239, 255, 0.18);
  color: #fff;
}

.ordersPeriodCustom {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(143, 239, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.ordersPeriodCustom.active {
  border-color: rgba(143, 239, 255, 0.55);
  background: rgba(143, 239, 255, 0.08);
}

.ordersPeriodCustom > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ordersPeriodCustomRow {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: end;
}

.ordersPeriodCustomRow label {
  display: grid;
  gap: 4px;
}

.ordersPeriodCustomRow label span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.ordersPeriodCustomRow input {
  min-height: 36px;
  border-radius: 10px;
  padding: 0 10px;
}

.ordersPeriodCustomRow button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 10px;
}

@media (max-width: 720px) {
  .ordersPeriodMonths {
    grid-template-columns: 1fr;
  }
  .ordersPeriodCustomRow {
    grid-template-columns: 1fr 1fr;
  }
  .ordersPeriodCustomRow button {
    grid-column: 1 / -1;
  }
}

/* Cancelled rows toggle. */
.ordersCancelledToggle {
  flex: 0 0 auto;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 11px;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.ordersCancelledToggle:hover {
  border-color: rgba(143, 239, 255, 0.45);
  color: #f6f8ff;
}

.ordersCancelledToggle.on {
  border-color: rgba(143, 239, 255, 0.55);
  background: rgba(143, 239, 255, 0.12);
  color: #f6f8ff;
}

.ordersCancelledToggleSwitch {
  position: relative;
  width: 30px;
  height: 16px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  transition: background .2s ease;
}

.ordersCancelledToggleSwitch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  transition: transform .2s ease;
}

.ordersCancelledToggle.on .ordersCancelledToggleSwitch {
  background: rgba(34, 211, 238, 0.7);
}

.ordersCancelledToggle.on .ordersCancelledToggleSwitch i {
  transform: translateX(14px);
}

.ordersCancelledToggle b {
  color: inherit;
  font-weight: 950;
}

/* Hide cancelled rows by default. */
.ordersRowCancelled {
  display: none;
}

body.ordersShowCancelled .ordersRowCancelled {
  display: table-row;
  opacity: 0.65;
}

body.ordersShowCancelled .ordersRowCancelled td {
  background: rgba(255, 92, 122, 0.05);
}

/* Live patch: make the orders table readable instead of inheriting product-table widths. */
.ordersLiveTableWrap {
  overflow-x: auto;
  border: 1px solid rgba(143, 239, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  -webkit-overflow-scrolling: touch;
}

.ordersLiveTableWrap::-webkit-scrollbar {
  height: 10px;
}

.ordersLiveTableWrap::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 999px;
}

.ordersLiveTableWrap::-webkit-scrollbar-thumb {
  background: rgba(143, 239, 255, 0.34);
  border-radius: 999px;
}

.ordersLiveTable {
  width: 100% !important;
  min-width: 0 !important;
  table-layout: fixed;
}

.ordersLiveTable th,
.ordersLiveTable td {
  padding: 10px 7px;
  vertical-align: top;
  line-height: 1.28;
  font-size: 12px;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.ordersLiveTable,
.ordersLiveTable * {
  overflow-wrap: normal !important;
  word-break: normal !important;
  hyphens: none !important;
}

.ordersLiveTable th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #0b1322;
  border-bottom-color: rgba(143, 239, 255, 0.18);
  color: #b7c6db;
  font-size: 10px;
  line-height: 1.12;
  white-space: normal;
  overflow-wrap: normal !important;
  word-break: normal !important;
}

.ordersLiveTable tbody tr:hover td {
  background: rgba(143, 239, 255, 0.045);
}

.ordersLiveTable th:nth-child(1),
.ordersLiveTable td:nth-child(1) {
  width: 12% !important;
}

.ordersLiveTable th:nth-child(2),
.ordersLiveTable td:nth-child(2) {
  width: 13% !important;
}

.ordersLiveTable th:nth-child(3),
.ordersLiveTable td:nth-child(3) {
  width: 24% !important;
}

.ordersLiveTable th:nth-child(4),
.ordersLiveTable td:nth-child(4) {
  width: 13% !important;
}

.ordersLiveTable th:nth-child(5),
.ordersLiveTable td:nth-child(5) {
  width: 22% !important;
}

.ordersLiveTable th:nth-child(11),
.ordersLiveTable td:nth-child(11) {
  width: 16% !important;
}

.ordersLiveTable td:nth-child(1) b {
  display: block;
  margin-bottom: 4px;
  white-space: nowrap;
}

.ordersLiveTable td:nth-child(2) {
  color: #eaf2ff;
  font-weight: 850;
  overflow-wrap: normal;
  word-break: normal;
}

.ordersLiveTable td:nth-child(2) small {
  display: inline-flex;
  margin-top: 6px;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ordersLiveTable td:nth-child(3) {
  color: #dfe8f7;
  overflow-wrap: normal;
  word-break: normal;
}

.ordersLiveTable td:nth-child(4) {
  overflow-wrap: normal;
  word-break: normal;
}

.ordersLiveTable td[data-live-col] {
  color: #eaf2ff;
  font-weight: 850;
  font-size: 11px;
}

.ordersLiveTable th[data-live-col] {
  color: #b9f3ff;
}

.ordersFinanceHiddenCol {
  display: none !important;
}

.ordersFinanceCell {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 8px;
  color: #eaf2ff;
}

.ordersFinanceCell span {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.ordersFinanceCell b {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ordersFinanceCell strong {
  overflow: hidden;
  color: #f6f8ff;
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ordersLiveTable td:nth-child(11) {
  white-space: nowrap;
  word-break: keep-all;
}

.ordersLiveTable td:nth-child(11) .receiptStatus {
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0 0 8px;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1.25;
  text-align: center;
}

.ordersLiveTable td:nth-child(11) .receiptStatus.not_configured {
  background: rgba(255, 211, 110, 0.16);
  color: #ffe8a8;
}

.ordersReceiptCell {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  justify-content: flex-start;
}

.ordersReceiptErrorHidden {
  display: none !important;
}

.ordersLiveTable td:nth-child(11) button {
  display: inline-flex;
  width: auto;
  min-width: 48px;
  min-height: 28px;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 10px;
  font-size: 11px;
  line-height: 1.1;
  white-space: nowrap;
  word-break: keep-all;
}

/* Live patch: move serial number editing out of the dense table. */
.ordersSerialHiddenEditor {
  display: none !important;
}

.ordersSerialOpenButton {
  width: 100%;
  min-height: 38px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 5px 6px;
  border: 1px solid rgba(143, 239, 255, 0.22);
  border-radius: 10px;
  background: rgba(143, 239, 255, 0.09);
  color: #dffbff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: normal;
  word-break: normal;
}

.ordersSerialOpenButton.filled {
  border-color: rgba(65, 225, 140, 0.34);
  background: rgba(65, 225, 140, 0.13);
  color: #caffdf;
}

.ordersSerialOpenButton span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ordersSerialOpenButton small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 950;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ordersSerialModalBackdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 20px;
  background: rgba(3, 7, 18, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ordersSerialModalBackdrop.open {
  display: grid;
}

.ordersSerialModal {
  position: relative;
  width: min(460px, 100%);
  padding: 24px;
  border: 1px solid rgba(143, 239, 255, 0.2);
  border-radius: 24px;
  background: radial-gradient(circle at 18% 0%, rgba(34, 211, 238, 0.13), transparent 13rem), #0b1422;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62);
  display: grid;
  gap: 12px;
}

.ordersSerialModal h3 {
  margin: 0;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.ordersSerialModal p {
  margin: -4px 0 4px;
  color: var(--muted);
  font-weight: 800;
}

.ordersSerialModal input {
  min-height: 48px;
  border-radius: 14px;
}

.ordersSerialKicker {
  color: #8fefff;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ordersSerialModalClose {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.ordersSerialModalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.ordersSerialModalActions .ghost,
.ordersSerialModalActions .primary {
  min-height: 40px;
  padding: 0 14px;
}

body.ordersSerialModalOpen {
  overflow: hidden;
}

@media (max-width: 900px) {
  .ordersLiveTable {
    min-width: 0 !important;
  }

  .ordersLiveTableWrap {
    border: 0;
    background: transparent;
    box-shadow: none;
  }

  .ordersLiveTable thead {
    display: none;
  }

  .ordersLiveTable,
  .ordersLiveTable tbody,
  .ordersLiveTable tr,
  .ordersLiveTable td {
    display: block;
    width: 100% !important;
  }

  .ordersLiveTable tr {
    margin-bottom: 12px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.05);
  }

  .ordersLiveTable td {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  }

  .ordersLiveTable td:last-child {
    border-bottom: 0;
  }

  .ordersLiveTable td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }

  .serialEditor {
    grid-template-columns: 1fr;
  }

  .serialEditor button.smallButton {
    width: 100%;
  }
}
