/* Compact admin Orders directory. Record detail keeps its existing layout. */
.module[data-workspace="orders"] > .workspace-shell-grid {
  grid-template-columns: minmax(0, 1fr);
}

.module[data-workspace="orders"] > .orders-directory-heading {
  margin-bottom: 0;
}

.module[data-workspace="orders"] > .orders-directory-heading h3 {
  margin: 0;
  font-family: inherit;
  font-size: 1.65rem;
  line-height: 1.25;
}

#orders-list-caption { margin: 6px 0 0; scroll-margin-top: 112px; }
#orders-list-caption:focus { outline: none; }

#orders-directory {
  width: 100%;
  min-width: 0;
  gap: 16px;
}

#orders-directory .orders-directory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

#orders-directory #orders-view-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 4px;
  width: fit-content;
  border: 1px solid var(--stroke);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.018);
}

#orders-directory .orders-view-button {
  min-width: 72px;
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  color: var(--muted);
  background: transparent;
  box-shadow: none;
}

#orders-directory .orders-view-button.is-active {
  border-color: rgba(142, 240, 203, 0.25);
  color: var(--mint);
  background: rgba(142, 240, 203, 0.075);
}

#orders-directory .orders-filter-bar {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(150px, 0.48fr) minmax(180px, 0.5fr) auto;
  align-items: end;
  gap: 12px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

#orders-directory .orders-filter-bar > div { min-width: 0; }
#orders-directory .orders-filter-bar label { display: block; margin: 0 0 6px; color: var(--muted); font-size: 0.82rem; font-weight: 500; }
#orders-directory .orders-filter-bar :is(input, select) { width: 100%; min-width: 0; min-height: 44px; margin: 0; padding: 10px 12px; border-radius: 9px; font-size: 0.9rem; }
#orders-directory .orders-filter-bar select {
  -webkit-appearance: none;
  appearance: none;
  height: 44px;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}
#orders-directory :is(.orders-form-actions, .orders-page-actions) { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin: 0; }
#orders-directory :is(.orders-form-actions, .orders-page-actions) button,
#orders-directory #orders-refresh { min-height: 44px; padding: 10px 14px; border-radius: 9px; font-size: 0.86rem; white-space: nowrap; }
#orders-directory #orders-status { min-height: 0; margin: 0; line-height: 1.4; font-size: 0.85rem; }
#orders-directory #orders-status:empty { display: none; }
#orders-directory #orders-results { min-width: 0; margin: 0; padding: 0; }

#orders-directory .orders-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  color: var(--ink-soft);
  font-size: 0.88rem;
}

#orders-directory .orders-table th {
  padding: 11px 12px;
  border-bottom: 1px solid var(--stroke-strong);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.025em;
  text-align: left;
}

#orders-directory .orders-table th:nth-child(1) { width: 14%; }
#orders-directory .orders-table th:nth-child(2) { width: 25%; }
#orders-directory .orders-table th:nth-child(3) { width: 16%; }
#orders-directory .orders-table th:nth-child(4) { width: 18%; }
#orders-directory .orders-table th:nth-child(5) { width: 16%; }
#orders-directory .orders-table th:nth-child(6) { width: 11%; text-align: right; }

#orders-directory .orders-table td {
  min-width: 0;
  height: 60px;
  padding: 6px 12px;
  border-bottom: 1px solid rgba(158, 187, 231, 0.1);
  vertical-align: middle;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

#orders-directory .orders-table tbody tr:hover { background: rgba(142, 240, 203, 0.025); }
#orders-directory .orders-table tbody tr:last-child td { border-bottom: 0; }
#orders-directory .orders-table :is(th, td):first-child { padding-left: 0; }
#orders-directory .orders-table :is(th, td):last-child { padding-right: 0; }

#orders-directory .orders-open-order {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 6px 0;
  border: 0;
  border-radius: 4px;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: 650;
  text-align: left;
  white-space: normal;
  overflow-wrap: anywhere;
}

#orders-directory .orders-open-order:hover { color: var(--mint); text-decoration: underline; text-underline-offset: 3px; transform: none; filter: none; box-shadow: none; }
#orders-directory .orders-cell-customer > :is(strong, span, small) { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#orders-directory .orders-cell-customer strong { color: var(--ink-soft); font-size: inherit; font-weight: 500; }
#orders-directory .orders-table .sub { margin: 2px 0 0; color: var(--muted); font-size: 0.76rem; line-height: 1.35; }
#orders-directory .orders-cell-service { font-size: 0.82rem; }
#orders-directory .orders-cell-date { font-size: 0.8rem; font-variant-numeric: tabular-nums; }
#orders-directory .orders-cell-date :is(span, time) { display: block; }
#orders-directory .orders-cell-total { color: var(--ink); text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
#orders-directory .orders-cell-status :is(.status-pill, .order-result-status) { display: inline-block; max-width: 100%; min-height: 0; padding: 5px 8px; border-radius: 7px; font-size: 0.76rem; font-weight: 500; line-height: 1.3; white-space: normal; letter-spacing: 0; text-transform: none; }

#orders-directory .orders-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 20px;
  padding-top: 16px;
  border-top: 1px solid var(--stroke);
}

#orders-page-summary { min-width: 0; margin: 0; font-size: 0.85rem; line-height: 1.4; }
#orders-directory .orders-empty { padding: 24px 16px; border: 1px solid var(--stroke); border-radius: 12px; color: var(--muted); line-height: 1.5; text-align: center; }
#orders-directory :is(button, input, select):focus-visible { outline: 2px solid var(--mint); outline-offset: 3px; }

@media (max-width: 1050px) {
  #orders-directory .orders-filter-bar { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; }
  #orders-directory .orders-search-field { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
  #orders-directory .orders-table,
  #orders-directory .orders-table tbody { display: block; }
  #orders-directory .orders-table thead { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #orders-directory .orders-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(95px, 0.65fr);
    gap: 6px 14px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(158, 187, 231, 0.14);
  }
  #orders-directory .orders-table tbody tr:last-child { border-bottom: 0; }
  #orders-directory .orders-table td { display: block; width: auto; height: auto; padding: 0; border: 0; }
  #orders-directory .orders-cell-order { grid-column: 1; grid-row: 1; }
  #orders-directory .orders-cell-total { grid-column: 2; grid-row: 1; align-self: center; }
  #orders-directory .orders-cell-customer { grid-column: 1; grid-row: 2; }
  #orders-directory .orders-cell-status { grid-column: 2; grid-row: 2; text-align: right; }
  #orders-directory .orders-cell-service { grid-column: 1; grid-row: 3; color: var(--muted); }
  #orders-directory .orders-cell-date { grid-column: 2; grid-row: 3; color: var(--muted); text-align: right; }
  #orders-directory .orders-cell-date::before { content: "Placed "; font-size: 0.73rem; }
  #orders-directory .orders-cell-date :is(span, time) { display: inline; }
  #orders-directory .orders-cell-date .sub { display: block; }
  #orders-directory .orders-open-order { min-height: 44px; padding: 0; }
}

@media (max-width: 520px) {
  #orders-directory { gap: 14px; }
  #orders-directory .orders-filter-bar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #orders-directory .orders-form-actions { grid-column: 1 / -1; }
  #orders-directory .orders-form-actions > button { flex: 1 1 0; }
  #orders-directory .orders-filter-bar :is(input, select) { font-size: 16px; }
  #orders-directory #orders-view-switch { gap: 0; padding: 2px; }
  #orders-directory .orders-view-button { min-width: 58px; padding: 8px 12px; }
  #orders-directory .orders-pagination { align-items: stretch; }
  #orders-directory .orders-page-actions { width: 100%; justify-content: space-between; }
  #orders-directory .orders-page-actions button { flex: 1 1 0; }
}
