/* Shared UI primitives. Pages move onto these one at a time.
   Home is the first. Other pages keep their own rules. */

.page-head .lede {
  flex: 1 0 100%;
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.ops-card {
  min-width: 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
}

.ops-card.is-warn {
  border-color: color-mix(in srgb, var(--sold) 55%, var(--line));
}

.ops-card .card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.6rem;
  margin: 0 0 0.35rem;
}

.ops-card .card-head h3 {
  margin: 0;
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.card-count {
  margin-left: auto;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.ops-card.is-warn .card-count {
  color: var(--sold);
}

.ops-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ops-card .row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 0;
  padding: 0.45rem 0 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  box-shadow: none;
}

.ops-card .row-title {
  min-width: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

.ops-card .row-sub {
  margin: 0.12rem 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.ops-card > .row-sub {
  margin: 0;
}

.ops-card .row .row-sub {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.ops-card .row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

/* One group head. Sales is the reference. --group-pad is 12px, 16px on the inventory board. */
.group + .group { border-top: 1px solid var(--line); }
.group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: var(--group);
  color: var(--ink);
  padding: 8px var(--group-pad, 12px);
  text-align: left;
  font: inherit;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
}
.group-head.is-static,
.group-head.is-empty { cursor: default; }
.group-head.is-empty { color: var(--muted); }
.group-caret { flex: 0 0 auto; width: 1rem; color: var(--muted); }
.group-name {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: inherit;
  font-weight: 650;
  letter-spacing: normal;
}
.group-note {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: 12px;
  font-weight: 450;
}
.group-note.is-late { color: var(--sold); }
.group-count {
  flex: 0 0 auto;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  height: 16px;
  padding: 0 6px;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--ink);
  font-family: Inter, sans-serif;
  font-size: 11px;
  font-weight: 650;
  line-height: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.group-meta,
.group-sum {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.group-meta { color: var(--muted); }
.group-sum {
  font-family: Inter, sans-serif;
  color: var(--muted);
}
.group-sub {
  margin: 0;
  padding: 16px var(--group-pad, 12px) 4px;
  color: var(--soft);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.group-body > .group-sub:first-child { padding-top: 8px; }

.text-action {
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
  border-radius: 0;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.text-action.is-muted {
  color: var(--muted);
  font-weight: 500;
}

.text-action:disabled {
  color: var(--muted);
  opacity: 0.55;
  cursor: default;
}

.chip-late {
  display: inline-flex;
  align-items: center;
  padding: 0 0.4rem;
  border-radius: var(--r-pill);
  background: var(--sold-bg);
  color: var(--sold);
  font-size: 10px;
  font-weight: 650;
  letter-spacing: 0.04em;
  line-height: 1.6;
  text-transform: capitalize;
}

.pill {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.pill[aria-pressed="true"] {
  border-color: var(--mark);
  color: var(--mark);
  background: transparent;
  font-weight: 600;
  box-shadow: none;
}

.pill-count {
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(var(--stat-cols, 6), minmax(0, 1fr));
  gap: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
}

.stat-tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  padding: 10px 14px 11px;
  background: transparent;
  border: 0;
  border-radius: 0;
}

.stat-tile + .stat-tile { box-shadow: inset 1px 0 0 var(--line-2); }

.stat-tile[data-stat="free"] { box-shadow: inset 1px 0 0 var(--line); }

.stat-tile .stat-label,
.stat-tile .stat-sub {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.stat-tile .stat-label {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-tile .stat-value {
  margin: 0;
  color: var(--ink);
  font-size: 16.5px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  line-height: 1.1;
}

.stat-tile .stat-sub {
  font-variant-numeric: tabular-nums;
}

.occ-head {
  margin: 14px 0 8px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
}

.concession-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 10px;
}

.bar-mini {
  height: 3px;
  background: var(--line);
  border-radius: 99px;
  overflow: hidden;
}

.bar-mini span {
  display: block;
  height: 100%;
  background: var(--ink);
}

.page-head.inventory-for {
  justify-content: flex-start;
  align-items: center;
  gap: 12px;
}

.inventory-range {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.inventory-for .span-modes {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 8px;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.inventory-for .span-modes button.pill,
.inventory-for .range-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink);
  box-shadow: none;
  padding: 4px 10px;
  font-size: 12.5px;
  white-space: nowrap;
}

.inventory-for .span-modes button.pill:last-child {
  border-right: 1px solid var(--line);
}

.inventory-for .span-modes button.pill[aria-pressed="true"] {
  border-color: var(--mark);
  color: var(--mark);
  background: transparent;
  font-weight: 600;
  box-shadow: none;
}

.comu-tag {
  display: inline-flex;
  align-items: center;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--parish) 16%, transparent);
  color: var(--parish);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.6;
  letter-spacing: 0.03em;
}

@media (max-width: 700px) {
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-tile + .stat-tile,
  .stat-tile[data-stat="free"] { box-shadow: none; }
  .stat-tile:nth-child(even) { box-shadow: inset 1px 0 0 var(--line-2); }
  .stat-tile:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .stat-tile .stat-sub { font-size: 11.5px; }
  .concession-row { grid-template-columns: 1fr; }
  .page-head.inventory-for { align-items: flex-start; }
  .inventory-for .inventory-range {
    overflow-x: auto;
    overflow-y: hidden;
  }
  .inventory-for .span-modes {
    flex-wrap: nowrap;
    max-width: none;
  }
  .inventory-for .span-modes button.pill {
    flex: 0 0 auto;
    min-width: max-content;
    padding: 4px 10px;
    font-size: 12.5px;
  }
}

.ops-skeleton {
  display: grid;
  gap: 10px;
  padding: 18px 0;
}

.ops-skeleton i {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: var(--line);
}

.ops-skeleton[data-skeleton="board"] i {
  height: 72px;
}

.ops-skeleton i:nth-child(odd) {
  background: var(--muted);
}

.ops-more {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0;
}

.ops-more p {
  margin: 0;
  color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
  .ops-skeleton,
  .ops-skeleton i {
    animation: none;
  }
}

/* Shared list layout. Moved from list.css. Sales is the reference. Pages opt in one at a time. */
.list-page { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-top: 14px; }
.list-page > .page-head { position: relative; margin: 0; padding-right: 15rem; }
.list-page > .page-head.no-tabs { padding-right: 0; }

.list-tabs { position: absolute; right: 0; top: 50%; transform: translateY(-50%); display: flex; align-items: center; }
.list-tabs button { border: 0; background: transparent; box-shadow: none; color: var(--ink); border-radius: 0; padding: 2px 8px 4px; font-size: 13px; font-weight: 500; line-height: 1.2; white-space: nowrap; }
.list-tabs button + button { box-shadow: inset 1px 0 0 var(--line); }
.list-tabs button.is-on { font-weight: 650; box-shadow: inset 0 -2px 0 var(--mark); }
.list-tabs button + button.is-on { box-shadow: inset 1px 0 0 var(--line), inset 0 -2px 0 var(--mark); }

.list-lede { margin: -8px 0 0; max-width: 42rem; color: var(--muted); font-size: 13px; }

.list-stats { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.list-stats p { margin: 0; color: var(--muted); font-size: 12px; }
.list-stats b { display: block; color: var(--ink); font-size: 15px; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -0.02em; }
.list-stats .is-warn b { color: var(--sold); }

.list-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; min-width: 0; }
.list-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.list-chip { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); background: var(--chip); color: var(--ink); border-radius: var(--r-pill); padding: 4px 10px; font-size: 12.5px; box-shadow: none; white-space: nowrap; font-weight: 450; }
.list-chip b { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--muted); font-size: 11.5px; }
.list-chip.is-on,
.list-chip[aria-pressed="true"] { background: var(--ink); color: var(--chip); border-color: var(--ink); }
.list-chip.is-on b,
.list-chip[aria-pressed="true"] b { color: var(--chip); }
.list-chip.is-select::after { content: "\25be"; color: var(--soft); font-size: 11px; margin-left: 2px; }
.list-search { display: flex; flex: 0 0 auto; align-items: center; gap: 6px; margin-left: auto; padding: 0 10px; min-width: 13rem; border: 1px solid var(--line); background: var(--chip); border-radius: var(--r-9); color: var(--placeholder); font-size: 13px; height: 32px; }
.list-search svg { width: 14px; height: 14px; color: var(--soft); flex: 0 0 auto; }
label.list-search input {
  width: 100%;
  border: 0;
  background: transparent;
  box-shadow: none;
  padding: 7px 0;
}
.list-tools .primary { padding: 6px 12px; }

.list-board { background: var(--card); border: 1px solid var(--line); border-radius: var(--r-12); overflow: hidden; min-width: 0; }
.list-board .group.is-warn { box-shadow: inset 3px 0 0 var(--sold); }

.list-cols { display: grid; grid-template-columns: var(--cols); gap: 10px; padding: 7px 12px; background: var(--table-head); border-bottom: 1px solid var(--line); color: var(--soft); font-size: 10.5px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; white-space: nowrap; }
.list-cols > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.list-cols .is-num { text-align: right; }

.list-row { display: grid; grid-template-columns: var(--cols); gap: 10px; align-items: center; min-height: 44px; padding: 7px 12px; border-top: 1px solid var(--line-2); color: var(--ink); font-size: 12.5px; cursor: pointer; }
.group-head + .group-body .list-row:first-child,
.list-cols + .list-row { border-top: 0; }
.list-row:hover { background: var(--table-head); }
.list-row > * { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.is-muted { color: var(--soft); }
.list-row.is-muted .list-name { color: var(--muted); font-weight: 600; }
.list-row.is-soon { box-shadow: inset 3px 0 0 var(--soon); }
.list-row.is-problem { box-shadow: inset 3px 0 0 var(--sold); }
button.list-row {
  margin: 0;
  width: 100%;
  padding: 7px 12px;
  border: 0;
  border-top: 1px solid var(--line-2);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  text-align: left;
}
.group-head + .group-body button.list-row:first-child,
.list-cols + button.list-row { border-top: 0; }
.list-main { white-space: normal; }
.list-name { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; font-weight: 650; letter-spacing: -0.01em; }
.list-quiet { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 12px; font-weight: 400; margin-top: 1px; }
.list-num { font-variant-numeric: tabular-nums; font-size: 12.5px; font-weight: 500; }
.list-num.is-right { text-align: right; }
.list-num.is-strong { font-weight: 650; }
.list-date { font-variant-numeric: tabular-nums; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.list-code { font-family: var(--mono); font-size: 11.5px; font-weight: 500; letter-spacing: 0; }
.list-muted { color: var(--muted); }
.list-who { display: flex; align-items: center; gap: 7px; }
.list-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--ink); color: var(--chip); font-size: 9.5px; font-style: normal; font-weight: 600; display: inline-grid; place-items: center; flex: 0 0 auto; }
.list-avatar.is-none { background: transparent; border: 1px dashed var(--line); color: var(--soft); }
.list-act { display: flex; justify-content: flex-end; gap: 12px; }

.list-pill { display: inline-flex; align-items: center; border-radius: var(--r-pill); padding: 1px 8px; font-size: 11.5px; font-weight: 600; line-height: 1.5; background: var(--chip); color: var(--ink); border: 1px solid var(--line-2); white-space: nowrap; }
.list-pill.is-free { background: var(--free-bg); color: var(--free-ink); border-color: transparent; }
.list-pill.is-sold { background: var(--sold-bg); color: var(--sold-ink); border-color: transparent; }
.list-pill.is-fixe { background: var(--fixe-bg); color: var(--fixe-ink); border-color: transparent; }
.list-pill.is-held { background: var(--held-bg); color: var(--held); border-color: transparent; }
.list-pill.is-hold { background: var(--hold-bg); color: var(--hold-ink); border-color: transparent; }
.list-pill.is-soon { background: var(--soon-bg); color: var(--soon-ink); border-color: transparent; }
.list-pill.is-quiet { background: transparent; color: var(--muted); }
.list-late { display: inline-flex; align-items: center; border-radius: var(--r-pill); padding: 0 6px; background: var(--sold-bg); color: var(--sold-ink); font-size: 11px; font-weight: 650; line-height: 1.45; }
.list-soon { display: inline-flex; align-items: center; border-radius: var(--r-pill); padding: 0 6px; background: var(--soon-bg); color: var(--soon-ink); font-size: 11px; font-weight: 650; line-height: 1.45; }

.list-thumbs { display: flex; gap: 4px; }
.list-thumb { width: 30px; height: 22px; border-radius: 4px; background: var(--group); border: 1px solid var(--line); }
.list-thumb.is-shot { background: linear-gradient(135deg, var(--map), var(--line) 60%, var(--group)); }
.list-thumb.is-proof { background: linear-gradient(160deg, var(--free-bg), var(--map) 55%, var(--line)); }

.list-foot { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.list-add { padding: 8px 12px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line-2); }

@media (max-width: 720px) {
  .list-page > .page-head { padding-right: 0; }
  .list-tabs { position: static; transform: none; margin-left: -8px; }
  .list-lede { display: none; }
  .list-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 12px; }
  .list-tools { flex-wrap: wrap; }
  .list-search { margin-left: 0; flex: 1 1 100%; min-width: 0; }
  .list-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .list-cols { display: none; }
  .list-row { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main end" "sub tail"; row-gap: 3px; padding: 9px 12px; }
  .list-row > * { display: none; }
  .list-row > .ph-main { display: block; grid-area: main; }
  .list-row > .ph-end { display: block; grid-area: end; text-align: right; }
  .list-row > .ph-sub { display: flex; grid-area: sub; }
  .list-row > .ph-tail { display: flex; grid-area: tail; justify-content: flex-end; }
  .list-row .ph-hide { display: none; }
  button.list-row { padding: 9px 12px; }
}
