/*
 * DarziOS PWA — SCR-ORD-03 Order Detail Master Hub 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.
 *
 * Doc 7 ergonomics: tabular numerals on every monetary / ID value,
 * 56px touch targets on actions, high-contrast labels.
 */

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

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

/* ---------------------------------------------------------------- body */
.hub__body {
  display: grid;
  grid-template-columns: 3fr 2fr;
  gap: var(--space-4);
  align-items: start;
}
@media (max-width: 900px) {
  .hub__body {
    grid-template-columns: 1fr;
  }
}
.hub-main {
  display: grid;
  gap: var(--space-4);
}
.hub-side {
  position: sticky;
  top: calc(var(--touch-min) + var(--space-3) + var(--space-3) + var(--space-4));
  display: grid;
  gap: var(--space-3);
  align-content: start;
}

/* -------------------------------------------------------------- cards */
.hub-card {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--surface-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.hub-card__title {
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
.hub-card__sub {
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  color: var(--chalk-muted);
}

/* ------------------------------------------------------ state strip */
.state-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-2);
}
.state-strip__pill {
  padding: 6px 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full, 999px);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--chalk-muted);
}
.state-strip__pill--done {
  border-color: var(--brand-brass);
  color: var(--chalk-white);
  background: var(--brass-faint);
}
.state-strip__pill--current {
  border-color: var(--brand-brass);
  background: var(--brand-brass);
  color: var(--on-brass);
  font-weight: var(--weight-bold);
}
.state-strip__pill--next {
  border-style: dashed;
}
.state-strip__arrow {
  color: var(--chalk-muted);
  font-size: var(--text-sm);
}

/* -------------------------------------------------------- timeline */
.timeline {
  display: grid;
  gap: var(--space-3);
}
.tl-item {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-3);
  align-items: start;
  padding-left: var(--space-3);
}
.tl-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: calc(-1 * var(--space-3));
  border-left: 2px solid var(--border-subtle);
}
.tl-item:last-child::before {
  display: none;
}
.tl-item--upcoming {
  opacity: 0.7;
}
.tl-item--upcoming::before {
  border-left-style: dashed;
}
.tl-item__body {
  display: grid;
  gap: 2px;
  padding-top: 2px;
}
.tl-item__label {
  font-size: var(--text-sm);
}
.tl-item__at {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--chalk-muted);
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ item */
.hub-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.hub-item__main {
  display: grid;
  gap: 2px;
}
.hub-item__name {
  font-size: var(--text-md);
  font-weight: var(--weight-semibold);
}
.hub-item__id {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--chalk-muted);
}

/* Measurement chip grid: shared in app.css (.meas-chips). */

/* ---------------------------------------------------------- facts */
.hub-facts {
  margin: 0;
  display: grid;
  gap: var(--space-2);
}
.hub-facts__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.hub-facts__k {
  font-size: var(--text-sm);
  color: var(--chalk-muted);
}
.hub-facts__v {
  margin: 0;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.hub-facts--money .hub-facts__v {
  font-size: var(--text-md);
  font-weight: var(--weight-bold);
}
.hub-facts__v--due {
  color: var(--brand-brass-light);
}

/* ---------------------------------------------------------- actions */
.hub-actions {
  display: grid;
  gap: var(--space-2);
}
.hub-action-hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--chalk-muted);
}
.hub-note {
  margin: 0;
  padding: var(--space-3);
  border: 1px dashed var(--border-subtle);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--chalk-muted);
}

/* ------------------------------------------------------- compact shell */
@media (max-width: 560px) {
  .hub {
    padding: var(--space-4);
  }
}
