/* Record › products (2026-10-03) — Claude's layout for Product costs.
   Zentrum tokens only; colours mean states (amber = needs a person, red = wrong). */

.pc-page > .card + .card,
.pc-page > .card + details.card { margin-top: var(--amino-space-6); }

/* ---- Cost per vial ---------------------------------------------------------- */
.pc-sum {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px 14px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--amino-surface-sunk, var(--amino-n-50));
}
.pc-fig { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pc-fig-label { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--amino-text-muted); }
.pc-fig-val { font-family: var(--amino-font-display); font-size: 30px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--amino-text); }
.pc-fig-sub { font-size: 12.5px; color: var(--amino-text-muted); }
.pc-fig-total .pc-fig-val { color: var(--z-accent); }
.pc-op { font-size: 22px; color: var(--amino-n-400); font-weight: 300; }

.pc-needs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pc-needs > span:first-of-type { flex: 1 1 260px; }
.pc-needs .spacer.right { margin-left: auto; }
.pc-pervial .flag.bad { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }

.pc-sub { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--amino-text-muted); margin: 4px 0 10px; }
.pc-group-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.pc-group {
  border: 1px solid var(--amino-border);
  border-radius: 14px;
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.pc-group-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.pc-group-val { font-family: var(--amino-font-display); font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-group-for { font-size: 13px; color: var(--amino-text-muted); }
.pc-makeup { display: flex; flex-direction: column; gap: 8px; }
.pc-bar { width: 100%; height: 8px; display: block; border-radius: 4px; overflow: hidden; background: var(--amino-n-100); }
.pc-parts { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.pc-parts li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 13px; }
.pc-swatch { width: 9px; height: 9px; border-radius: 50%; }
.pc-part-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-part-val { font-variant-numeric: tabular-nums; color: var(--amino-text-muted); }

.pc-types .pc-type-table td.pc-full { font-weight: 700; }
.pc-types .z-note { margin-top: 10px; }

/* ---- Purchases ---------------------------------------------------------------- */
.pc-quick {
  display: grid;
  grid-template-columns: 150px 170px minmax(140px, 1fr) 120px 150px auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--amino-surface-sunk, var(--amino-n-50));
}
.pc-quick input,
.pc-quick select {
  min-width: 0;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--amino-border);
  border-radius: var(--amino-radius-md);
  background: var(--amino-surface);
  color: var(--amino-text);
  font-size: 13.5px;
}
.pc-quick .pc-quick-amt { text-align: right; font-variant-numeric: tabular-nums; }
.pc-quick-msg { grid-column: 1 / -1; font-size: 12px; color: var(--amino-text-muted); }
.pc-quick-msg.warn { color: var(--z-warn); font-weight: 600; }

.pc-filters .ledger-toolbar { margin-bottom: 0; }
.pc-more { margin-top: 8px; }
.pc-more > summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--z-accent); list-style: none; width: max-content; }
.pc-more > summary::-webkit-details-marker { display: none; }
.pc-more > summary::before { content: "▸"; display: inline-block; width: 1.1em; transition: transform .15s; }
.pc-more[open] > summary::before { transform: rotate(90deg); }
.pc-more[open] > .ledger-toolbar { margin-top: 8px; }

.pc-table td { vertical-align: middle; }
.pc-table td.pc-cat { white-space: nowrap; }
.pc-table td.pc-covers,
.pc-table td.pc-for-cell { white-space: nowrap; }
.pc-for { display: inline-block; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--amino-text-muted); }

.pc-table tr.pc-month td {
  padding: 14px 12px 8px;
  background: transparent !important;
  border-bottom: 1px solid var(--amino-border);
}
.pc-table tbody + tbody tr.pc-month td { padding-top: 22px; }
.pc-month-bar { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; }
.pc-month-name { font-weight: 700; font-size: 15px; color: var(--amino-text); }
.pc-month-n { font-size: 12.5px; color: var(--amino-text-muted); }
.pc-month-tot { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }
.pc-month-run { font-variant-numeric: tabular-nums; color: var(--amino-text-muted); }
.pc-k { font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--amino-text-muted); margin-right: 4px; }
.pc-group-rows.undated .pc-month-name { color: var(--z-warn); }

/* Chips: amber = needs a person, red = wrong. */
.pc-chip {
  display: inline-flex; align-items: center;
  border: 0; border-radius: 999px;
  padding: 3px 10px;
  font: 600 12px/1.4 var(--amino-font-sans);
  white-space: nowrap;
}
/* Amber per row reads as text, not a pill: the flag above the list carries the count. */
.pc-chip.warn { background: none; padding: 0; color: var(--z-warn); font-weight: 500; }
button.pc-chip.warn { text-decoration: underline dotted; text-underline-offset: 3px; }
.pc-chip.bad { background: var(--z-bad-bg); color: var(--z-bad); }
button.pc-chip { cursor: pointer; }
button.pc-chip.warn:hover { text-decoration-style: solid; }
button.pc-chip:focus-visible { outline: none; box-shadow: var(--amino-shadow-focus); }
.pc-allvials { color: var(--amino-text-muted); border-bottom: 1px dotted var(--amino-n-400); cursor: help; }
.pc-tip { cursor: help; }
/* Tooltips in the right-hand columns open leftward so they stay on the page. */
.pc-table td.pc-covers [data-tip]::after,
.pc-table td.pc-for-cell [data-tip]::after { left: auto; right: 0; top: calc(100% + 6px); transform: none; width: max-content; max-width: 260px; white-space: normal; z-index: 5; }

/* ---- Reference tables ---------------------------------------------------------- */
.pc-recog .z-note { margin-top: 2px; }
.pc-inv > summary.pc-inv-sum {
  cursor: pointer; list-style: none;
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
}
.pc-inv > summary::-webkit-details-marker { display: none; }
.pc-inv > summary strong { font-size: 17px; }
.pc-inv > summary strong::before { content: "▸"; display: inline-block; width: 1.1em; color: var(--z-accent); transition: transform .15s; }
.pc-inv[open] > summary strong::before { transform: rotate(90deg); }
.pc-inv-line { display: block; font-size: 13.5px; margin-top: 2px; padding-left: 1.1em; }
.pc-inv-tot { font-variant-numeric: tabular-nums; font-weight: 600; }
.pc-inv > .card { box-shadow: none; background: transparent; border: 0; padding: 0; margin-top: 12px !important; }
.pc-inv > .card > .row:first-child h3 { display: none; }

/* ---- Narrow screens -------------------------------------------------------------- */
@media (max-width: 760px) {
  .pc-sum { grid-template-columns: 1fr auto; padding: 14px; }
  .pc-sum .pc-op { display: none; }
  .pc-sum .pc-fig { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
  .pc-sum .pc-fig-sub { flex-basis: 100%; }
  .pc-sum .pc-fig + .pc-op + .pc-fig { border-top: 1px solid var(--amino-border); padding-top: 8px; }
  .pc-fig-val { font-size: 22px; }
  .pc-quick { grid-template-columns: 1fr 1fr; }
  .pc-quick .pc-quick-vendor { grid-column: 1 / -1; }
  .pc-quick .btn { grid-column: 1 / -1; }
  .pc-month-tot { margin-left: 0; }
}
@media (max-width: 760px) {
  /* Keep each month's totals in view while the table scrolls sideways. */
  .pc-month-bar { position: sticky; left: 12px; max-width: calc(100vw - 72px); }
  .pc-month-tot, .pc-month-run { flex-basis: 100%; }
}

/* Phone (polish, 2026-10-03): each purchase becomes a small card, as on Expenses,
   so the amount is never off-screen. Vendor and amount, then details, then actions. */
@media (max-width: 600px) {
  .pc-rows { overflow: visible; }
  .pc-rows table.records { display: block; min-width: 0; }
  .pc-rows table.records thead { display: none; }
  .pc-rows table.records tbody { display: block; }
  .pc-rows table.records tr { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 0; padding: 10px 2px; border-bottom: 1px solid var(--amino-border); }
  .pc-rows table.records td { display: block; border: 0; padding: 0; white-space: normal; }
  .pc-rows table.records tbody tr:hover td { background: transparent; }
  .pc-rows td.pc-vendor { order: 1; flex: 1 1 0; min-width: 0; font-weight: 600; overflow-wrap: anywhere; }
  .pc-rows td.pc-amt { order: 2; flex: none; padding-left: 10px; }
  .pc-rows td.pc-date, .pc-rows td.pc-cat, .pc-rows td.pc-method, .pc-rows td.pc-for-cell, .pc-rows td.pc-covers {
    order: 3; font-size: 12.5px; color: var(--amino-text-muted);
  }
  .pc-rows td.pc-date { flex-basis: 100%; }
  .pc-rows td.pc-cat::after, .pc-rows td.pc-for-cell::after, .pc-rows td.pc-covers::after { content: "·"; margin: 0 6px; }
  .pc-rows td.pc-actions { order: 4; flex-basis: 100%; margin-top: 6px; width: auto; }
  .pc-rows td.pc-actions .actions-cell { flex-wrap: wrap; justify-content: flex-start; }
  .pc-rows table.records tr.pc-month { padding: 0; border: 0; }
  .pc-rows table.records tr.pc-month td { flex-basis: 100%; padding: 16px 2px 8px; }
  .pc-rows .pc-month-bar { position: static; max-width: none; }
  .pc-rows table.records tr.empty td { padding: 12px 2px; }
}
