/*
 * DarziOS PWA — SCR-ORD-02 Order Directory styles (production).
 *
 * Owner rule (strict): every color, spacing value, radius, shadow and
 * duration in this file resolves to a custom property in
 * css/design-tokens.css. Zero raw color literals. Control patterns
 * (buttons, tags) come from css/controls.css; .sample-chip lives in
 * css/app.css.
 */

/* ---------------------------------------------------------------- page */
.ord {
  max-width: 1160px;
  margin: 0 auto;
  padding: var(--space-6);
  display: grid;
  gap: var(--space-4);
}

.ord__toolbar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.ord__titles {
  display: grid;
  gap: var(--space-1);
  min-width: 0;
}
.ord__title {
  margin: 0;
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
}
.ord__ctx {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--chalk-muted);
  font-variant-numeric: tabular-nums;
}
.ord__toolbar .sample-chip {
  margin-left: auto;
}

/* -------------------------------------------------------- filter pills */
.ord__filters {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.ord-pill {
  padding: 8px 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  background: var(--surface-elevated);
  color: var(--chalk-white);
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard);
}
.ord-pill:hover:not(.ord-pill--active) {
  border-color: var(--brand-brass);
}
.ord-pill--active {
  border-color: var(--brand-brass);
  background: var(--brand-brass);
  color: var(--on-brass);
  font-weight: var(--weight-semibold);
}

/* ------------------------------------------------------------ table */
.ord-card {
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.ord-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
}
.ord-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  color: var(--chalk-muted);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ord-table td {
  padding: var(--space-3) var(--space-4);
  border-top: 1px dashed var(--border-subtle);
  font-variant-numeric: tabular-nums;
}
.ord-table__id {
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
}
.ord-table__num {
  text-align: right;
}
.ord-table__due--warn {
  color: var(--status-warning);
}
.ord-table__empty {
  text-align: center;
  color: var(--chalk-muted);
  padding: var(--space-8) var(--space-4);
}
/* Demo: the hub's sample order opens SCR-ORD-03. */
.ord-table__row--hub {
  cursor: pointer;
}
.ord-table__row--hub:hover td {
  background: var(--brass-faint);
}

/* Narrow screens: drop the delivery column (status carries it). */
@media (max-width: 700px) {
  .ord-table th:nth-child(5),
  .ord-table td:nth-child(5) {
    display: none;
  }
}

/* ------------------------------------------------------- compact shell */
/* Smartphone (Doc 7 §16): tighter gutters; the directory table
   scrolls horizontally instead of crushing its columns. */
@media (max-width: 560px) {
  .ord {
    padding: var(--space-4);
  }
  .ord-table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    min-width: 600px;
  }
  .ord-table th,
  .ord-table td {
    white-space: nowrap;
  }
}
