/* Shared order surfaces: one visual rhythm for the hall and order details. */
.main-content > .order-center-page,
.main-content > .external-orders-view,
.main-content > div:has(> .orders-table-wrap) {
  width: 100%;
  margin: 0;
}

.main-content > .order-center-page {
  padding-bottom: 24px;
}

.main-content > .order-center-page .toolbar-panel,
.main-content > div:has(> .orders-table-wrap) > .filter-bar {
  position: sticky;
  top: 0;
  z-index: 4;
  border-color: #dfe6f1;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.main-content > .order-center-page .list-panel,
.main-content > div:has(> .orders-table-wrap) > .orders-table-wrap {
  border-color: #dfe6f1;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

.main-content > .order-center-page .order-table th,
.main-content > div:has(> .orders-table-wrap) .orders-table th {
  background: #f7f9fc;
  color: #475569;
}

.main-content > .order-center-page .detail-layout {
  align-items: stretch;
}

.main-content > .order-center-page .detail-left-panel,
.main-content > .order-center-page .detail-side-panel {
  border-color: #e2e8f0;
  background: #fff;
}

.canonical-order-hall {
  width: 100%;
  margin: 0;
  padding: 8px 0 24px;
  color: #172033;
}

.order-surface-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.order-surface-eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #64748b;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.order-surface-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: 26px;
  line-height: 1.2;
}

.order-surface-heading p {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 13px;
}

.order-surface-heading__actions,
.order-filter-actions,
.order-pagination > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.surface-button {
  min-height: 34px;
  padding: 0 13px;
  border: 1px solid #d7deea;
  border-radius: 6px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}

.surface-button:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #f8fafc;
}

.surface-button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.surface-button--primary {
  border-color: #3157c8;
  background: #3157c8;
  color: #fff;
}

.surface-button--primary:hover:not(:disabled) {
  border-color: #2646a8;
  background: #2646a8;
}

.surface-button--block {
  width: 100%;
}

.order-filter-panel,
.order-table-shell,
.order-card,
.order-surface-toolbar,
.order-pagination {
  border: 1px solid #e1e7f0;
  background: #fff;
  box-shadow: 0 5px 18px rgba(15, 23, 42, .045);
}

.order-filter-panel {
  padding: 16px;
  border-radius: 8px;
}

.order-filter-grid {
  display: grid;
  grid-template-columns: minmax(190px, 1.25fr) repeat(3, minmax(125px, 1fr)) auto;
  align-items: end;
  gap: 12px;
}

.order-filter-grid label {
  display: grid;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
  font-weight: 600;
}

.order-filter-grid input,
.order-filter-grid select {
  width: 100%;
  height: 34px;
  padding: 0 10px;
  border: 1px solid #d7deea;
  border-radius: 5px;
  background: #fff;
  color: #1e293b;
  outline: 0;
  font-size: 13px;
}

.order-filter-grid input:focus,
.order-filter-grid select:focus {
  border-color: #5272d3;
  box-shadow: 0 0 0 3px rgba(49, 87, 200, .12);
}

.order-surface-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  padding: 11px 14px;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
}

.order-surface-toolbar > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.order-surface-toolbar strong {
  color: #0f172a;
  font-size: 14px;
}

.order-surface-toolbar span {
  color: #94a3b8;
  font-size: 12px;
}

.order-view-switch {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid #d7deea;
  border-radius: 5px;
}

.order-view-switch button {
  min-width: 56px;
  height: 28px;
  border: 0;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 12px;
}

.order-view-switch button + button {
  border-left: 1px solid #d7deea;
}

.order-view-switch button.is-active {
  background: #eef2ff;
  color: #3157c8;
  font-weight: 700;
}

.order-table-shell {
  overflow: auto;
  min-height: 520px;
  border-radius: 0 0 8px 8px;
}

.canonical-order-hall .order-table {
  width: 100%;
  min-width: 1032px;
  table-layout: fixed;
}

.canonical-order-hall .order-table th {
  position: relative;
  text-align: left;
}

.order-column-resizer {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: -5px;
  width: 11px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: col-resize;
  touch-action: none;
}

.order-column-resizer::after {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 1px;
  height: 20px;
  border-radius: 1px;
  background: #d6deea;
  content: "";
  transition: width 160ms ease, background 160ms ease;
}

.order-column-resizer:hover::after,
.order-column-resizer:focus-visible::after {
  width: 2px;
  background: #5574d8;
}

.order-column-resizer:focus-visible {
  outline: 2px solid rgba(49, 87, 200, .28);
  outline-offset: -2px;
}

body.is-resizing-order-column,
body.is-resizing-order-column * {
  cursor: col-resize !important;
  user-select: none !important;
}

.order-table th {
  height: 42px;
  padding: 0 12px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-table td {
  height: 58px;
  padding: 8px 12px;
  border-top: 1px solid #edf1f6;
  color: #334155;
  font-size: 13px;
  vertical-align: middle;
}

.canonical-order-hall .order-table td {
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-table tbody tr:hover {
  background: #fbfdff;
}

.order-id-cell {
  color: #3157c8;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.order-game,
.order-subline {
  display: block;
}

.order-game {
  color: #1e293b;
  font-weight: 700;
}

.order-subline {
  max-width: 240px;
  margin-top: 3px;
  overflow: hidden;
  color: #94a3b8;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-content-value {
  overflow: hidden;
  color: #475569;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-content-cell {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.order-copy-button {
  flex: 0 0 auto;
  min-width: 44px;
  height: 26px;
  padding: 0 9px;
  border: 1px solid #d8e0ec;
  border-radius: 6px;
  background: #fff;
  color: #49607d;
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.order-copy-button:hover,
.order-copy-button:focus-visible {
  border-color: #91a7e8;
  background: #f4f7ff;
  color: #3157c8;
}

.order-copy-button.is-copied {
  border-color: #86d6ad;
  background: #effbf4;
  color: #168454;
}

.order-content-button {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  padding: 5px 4px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #475569;
  cursor: pointer;
  font: inherit;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-content-button:hover,
.order-content-button:focus-visible {
  background: #f2f5fb;
  color: #3157c8;
  outline: none;
}

.order-content-dialog-backdrop {
  position: fixed;
  z-index: 2400;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(2px);
}

.order-content-dialog {
  width: min(680px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(215, 222, 234, .92);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .2);
}

.order-content-dialog__header,
.order-content-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
}

.order-content-dialog__header {
  border-bottom: 1px solid #edf1f6;
}

.order-content-dialog__header span {
  color: #64748b;
  font-size: 12px;
}

.order-content-dialog__header h2 {
  margin: 3px 0 0;
  color: #1e293b;
  font-size: 18px;
  line-height: 1.35;
}

.order-dialog-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: #f5f7fa;
  color: #64748b;
  cursor: pointer;
  font-size: 23px;
  line-height: 1;
}

.order-dialog-close:hover,
.order-dialog-close:focus-visible {
  background: #eaf0ff;
  color: #3157c8;
  outline: none;
}

.order-content-dialog__body {
  max-height: calc(100vh - 260px);
  min-height: 150px;
  overflow: auto;
  padding: 22px 20px;
}

.order-content-dialog__body p {
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.order-content-dialog__footer {
  border-top: 1px solid #edf1f6;
  background: #fafbfc;
}

.order-content-dialog__footer > span {
  color: #b45309;
  font-size: 14px;
  font-weight: 700;
}

.order-card__content-button {
  width: 100%;
  border: 0;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.order-requirement {
  color: #334155;
  font-weight: 650;
  white-space: nowrap;
}

.order-price {
  color: #b45309;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.order-date-cell {
  min-width: 104px;
}

.order-date-value {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
  white-space: nowrap;
}

.order-date-value strong {
  color: #334155;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.order-date-value small {
  color: #94a3b8;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.order-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.order-status--warning { background: #fff7ed; color: #c2410c; }
.order-status--primary { background: #eff6ff; color: #1d4ed8; }
.order-status--success { background: #ecfdf5; color: #047857; }
.order-status--muted { background: #f1f5f9; color: #64748b; }

.order-surface-error {
  margin-top: 12px;
  padding: 11px 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fff1f2;
  color: #b91c1c;
  font-size: 13px;
}

.order-surface-empty {
  padding: 56px 20px !important;
  color: #94a3b8 !important;
  text-align: center;
}

.order-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #64748b;
  font-size: 13px;
}

.order-pagination__controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 14px;
}

.order-pagination__summary {
  display: none;
  color: #64748b;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.order-page-buttons {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid #dbe2ec;
  border-radius: 6px;
  background: #fff;
}

.order-page-button {
  min-width: 40px;
  height: 34px;
  padding: 0 10px;
  border: 0;
  border-right: 1px solid #e5eaf1;
  background: #fff;
  color: #64748b;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}

.order-page-button:last-child {
  border-right: 0;
}

.order-page-button:hover:not(:disabled),
.order-page-button:focus-visible {
  background: #f3f6fd;
  color: #3157c8;
  outline: none;
}

.order-page-button.is-current {
  background: #f3f6ff;
  color: #3157c8;
  cursor: default;
  font-weight: 750;
}

.order-page-button:disabled {
  background: #fbfcfd;
  color: #c4ccd8;
  cursor: not-allowed;
}

.order-page-button--arrow {
  font-family: Arial, sans-serif;
  font-size: 20px;
  font-weight: 400;
}

.order-page-size {
  display: inline-flex;
  align-items: center;
}

.order-page-size__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.order-page-size select {
  min-width: 126px;
  height: 36px;
  padding: 0 34px 0 12px;
  border: 1px solid #d7deea;
  border-radius: 6px;
  background-color: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 13px;
}

.order-page-size select:hover {
  border-color: #a8b5c7;
}

.order-page-size select:focus-visible {
  border-color: #5574d8;
  outline: 3px solid rgba(49, 87, 200, .14);
}

.order-total-count {
  min-width: 62px;
  color: #64748b;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.order-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.order-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 8px;
}

.order-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.order-card h3 {
  margin: 0;
  color: #1e293b;
  font-size: 16px;
}

.order-card__content {
  min-height: 36px;
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.55;
}

.order-card__project {
  color: #64748b;
  font-size: 12px;
}

.order-card__meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.order-card__meta div {
  padding: 9px 10px;
  border-radius: 5px;
  background: #f8fafc;
}

.order-card__meta dt {
  color: #94a3b8;
  font-size: 11px;
}

.order-card__meta dd {
  margin: 5px 0 0;
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1000px) {
  .order-filter-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .order-filter-actions { justify-content: flex-start; }
}

@media (max-width: 640px) {
  .order-surface-heading { display: block; }
  .order-surface-heading__actions { margin-top: 14px; }
  .order-filter-grid { grid-template-columns: 1fr; }
  .order-surface-toolbar { align-items: flex-start; flex-direction: column; }
  .order-pagination { align-items: stretch; justify-content: flex-start; }
  .order-pagination__summary { display: none; }
  .order-pagination__controls { flex-wrap: wrap; gap: 10px; }
  .order-table-shell { min-height: 430px; }
  .order-card__meta { grid-template-columns: 1fr; }
}

.main-content > .order-center-page .detail-left-panel {
  padding: 2px;
  border-radius: 14px;
}

.main-content > .order-center-page .detail-side-panel {
  box-shadow: 0 5px 16px rgba(15, 23, 42, .05);
}

.main-content > .order-center-page .detail-grid > div {
  border-color: #e6ebf2;
  background: #f8fafc;
}

.external-orders-view {
  display: flex;
  min-height: calc(100vh - 104px);
  flex-direction: column;
  gap: 14px;
}

.external-orders-view__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 2px 2px 0;
}

.external-orders-view__eyebrow {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .08em;
}

.external-orders-view h1 {
  margin: 5px 0 0;
  color: #172033;
  font-size: 24px;
  line-height: 1.2;
}

.external-orders-view p {
  margin: 6px 0 0;
  color: #64748b;
  font-size: 13px;
}

.external-orders-view__frame {
  width: 100%;
  min-height: 720px;
  flex: 1;
  border: 1px solid #dfe6f1;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .07);
}

@media (max-width: 900px) {
  .main-content > .order-center-page .toolbar-panel,
  .main-content > div:has(> .orders-table-wrap) > .filter-bar {
    position: static;
  }

  .external-orders-view__frame {
    min-height: 620px;
  }
}

.date-range-field { min-width: 270px; }
.date-range-controls { display: flex; align-items: center; gap: 6px; }
.date-range-controls input { min-width: 0; flex: 1; }
.date-range-controls span { color: #64748b; font-size: 12px; }
@media (max-width: 640px) { .date-range-field { min-width: 0; } .date-range-controls { width: 100%; } }
