/* ==========================================================================
   The customer account's newer screens
   --------------------------------------------------------------------------
   Buy again, saved lists, the price list, notifications and team
   (assets/js/pages/account-*.js). Loads after dashboard.css and
   account.css, uses their tokens and parts (.panel, .row-card, .input,
   .pill), and adds only what those screens need.
   ========================================================================== */

/* ── the side list, now grouped ───────────────────────────────────────── */

body.acct .side-nav { gap: 0.15rem; max-height: calc(100dvh - 110px); overflow-y: auto; scrollbar-width: thin; }
body.acct .side-nav a { padding: 0.62rem 0.9rem; font-size: 0.97rem; }
.side-nav__label {
  margin: 0.9rem 0 0.25rem;
  padding: 0 0.9rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
}
.side-nav__label:first-child { margin-top: 0; }
@media (max-width: 820px) {
  .side-nav__label { display: none; }
  body.acct .side-nav { max-height: none; }
}

/* ── shared: a row of tools under a panel's head ──────────────────────── */

.acct-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; }
.acct-tools__search { flex: 1 1 280px; max-width: 440px; }
.acct-tools__sort { flex: 0 0 auto; width: auto; }
.acct-tools__end { display: flex; align-items: center; gap: 0.5rem; margin-left: auto; }
.acct-tools__end[hidden] { display: none; }
.acct-tools__n { font-size: 0.92rem; font-weight: 600; color: var(--text-2); margin-right: 0.25rem; }
.acct-head-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.acct-inline-form { max-width: 620px; }
.acct-inline-form__row { display: flex; gap: 0.6rem; margin-top: 0.4rem; }
.acct-inline-form__row .input { flex: 1 1 auto; }
.acct-inline-form .alert { margin-top: 0.75rem; }
@media (max-width: 520px) { .acct-inline-form__row { flex-direction: column; } }

/* ── buy again / a list's lines ───────────────────────────────────────── */

.buy-list { display: grid; gap: 0.6rem; }
.buy-row {
  display: grid;
  grid-template-columns: auto 64px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  padding: 0.8rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
}
.buy-row--list { grid-template-columns: 64px minmax(0, 1fr) auto auto; }
.buy-row.is-gone { background: var(--surface-2); }
.buy-row.is-gone .buy-row__pic, .buy-row.is-gone .buy-row__name { opacity: 0.6; }
.buy-row__pick input { width: 18px; height: 18px; accent-color: var(--accent); }
.buy-row__pic {
  width: 64px; height: 64px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  overflow: hidden;
}
.buy-row__pic img { max-width: 90%; max-height: 90%; object-fit: contain; mix-blend-mode: var(--photo-blend, multiply); }
.buy-row__name { font-weight: 600; letter-spacing: -0.01em; }
.buy-row__name a { color: inherit; }
.buy-row__name a:hover { color: var(--accent); }
.buy-row__detail { margin-top: 0.1rem; font-size: 0.92rem; color: var(--text-2); }
.buy-row__meta { margin-top: 0.2rem; font-size: 0.85rem; color: var(--text-3); }
.buy-row__price { display: grid; justify-items: end; text-align: right; font-variant-numeric: tabular-nums; }
.buy-row__price strong { font-size: 1.05rem; font-weight: 600; }
.buy-row__price span { font-size: 0.8rem; color: var(--text-3); }
.buy-row__end { display: flex; align-items: center; gap: 0.5rem; justify-content: flex-end; min-width: 220px; }
.buy-row__qty { width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; }
.buy-row__q { font-variant-numeric: tabular-nums; color: var(--text-2); }
.buy-row__gone { font-size: 0.88rem; color: var(--text-3); }

@media (max-width: 760px) {
  .buy-row { grid-template-columns: auto 52px minmax(0, 1fr); gap: 0.6rem 0.8rem; }
  .buy-row--list { grid-template-columns: 52px minmax(0, 1fr); }
  .buy-row__pic { width: 52px; height: 52px; }
  .buy-row__price { grid-column: -2 / -1; justify-items: start; text-align: left; display: flex; gap: 0.4rem; align-items: baseline; }
  .buy-row__end { grid-column: 1 / -1; min-width: 0; justify-content: stretch; }
  .buy-row__end .btn { flex: 1 1 auto; }
  .acct-tools__end { margin-left: 0; width: 100%; }
}

/* ── saved lists ──────────────────────────────────────────────────────── */

.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0.8rem; }
.list-card {
  display: grid; gap: 0.3rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--line-soft);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text);
  transition: border-color var(--fast) var(--ease);
}
.list-card:hover { border-color: var(--accent); }
.list-card__name { font-weight: 600; font-size: 1.05rem; letter-spacing: -0.01em; }
.list-card__meta { font-size: 0.88rem; color: var(--text-3); }
.list-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem;
  margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--line-soft);
  color: var(--text-2); font-size: 0.95rem;
}
.list-foot strong { color: var(--text); font-variant-numeric: tabular-nums; }
.list-pick { display: grid; gap: 0.5rem; border: 0; padding: 0; margin: 0; }
.list-pick__opt { display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem; border: 1px solid var(--line-soft); border-radius: var(--r-sm); cursor: pointer; }
.list-pick__opt small { margin-left: 0.4rem; color: var(--text-3); }
.list-pick__opt input { accent-color: var(--accent); }

/* ── price list ───────────────────────────────────────────────────────── */

.price-list .alert { margin-bottom: 1.1rem; }
.price-list__table th:nth-child(2), .price-list__sku { color: var(--text-3); font-size: 0.86rem; white-space: nowrap; }
.price-list__name { font-weight: 600; }
.price-list__meta { margin-top: 0.15rem; font-size: 0.86rem; color: var(--text-3); }
.price-list__meta .link-btn { font-size: inherit; }
.price-list__opt td:first-child { padding-left: 1.75rem; color: var(--text-2); }
.price-list__opt td { background: var(--surface-2); }
.price-list__list { color: var(--text-3); }
.price-list__off { color: var(--ok); font-size: 0.86rem; white-space: nowrap; }
.price-list__from { font-size: 0.8rem; color: var(--text-3); }
.price-list__note { margin-top: 1rem; }

/* ── notifications ────────────────────────────────────────────────────── */

.notify__group { margin: 1.25rem 0 0.5rem; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.notify__group:first-of-type { margin-top: 0.25rem; }
.notify { display: grid; border: 1px solid var(--line-soft); border-radius: var(--r-md); max-width: 760px; }
.notify__row { display: flex; align-items: center; gap: 1.25rem; padding: 0.95rem 1.15rem; cursor: pointer; }
.notify__row + .notify__row { border-top: 1px solid var(--line-soft); }
.notify__text { display: grid; gap: 0.15rem; flex: 1 1 auto; }
.notify__text span { font-size: 0.9rem; color: var(--text-2); }
.notify__always { display: grid; gap: 0.35rem; padding-left: 1.1rem; color: var(--text-2); font-size: 0.95rem; max-width: 760px; }

.switch { position: relative; flex: 0 0 auto; width: 44px; height: 26px; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.switch__track { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong); transition: background-color var(--fast) var(--ease); }
.switch__track::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2); transition: transform var(--fast) var(--ease);
}
.switch input:checked + .switch__track { background: var(--accent); }
.switch input:checked + .switch__track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent-ring); outline-offset: 2px; }
.switch input:disabled + .switch__track { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .switch__track, .switch__track::after { transition: none; } }

/* ── team ─────────────────────────────────────────────────────────────── */

.team-list { display: grid; border: 1px solid var(--line-soft); border-radius: var(--r-md); }
.team-row { display: flex; align-items: center; gap: 0.9rem; padding: 0.85rem 1.1rem; }
.team-row + .team-row { border-top: 1px solid var(--line-soft); }
.team-row.is-pending { background: var(--surface-2); }
.team-row__avatar { flex: 0 0 auto; }
.team-row__main { flex: 1 1 auto; min-width: 0; }
.team-row__name { font-weight: 600; }
.team-row__you { font-weight: 400; color: var(--text-3); }
.team-row__meta { font-size: 0.88rem; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.team-row__act { flex: 0 0 auto; }
@media (max-width: 560px) {
  .team-row { flex-wrap: wrap; }
  .team-row__main { flex-basis: calc(100% - 3.5rem); }
}

/* ── printing the price list ──────────────────────────────────────────── */

@media print {
  body[data-printing="prices"] .dash-nav,
  body[data-printing="prices"] .side-nav,
  body[data-printing="prices"] #pricingBanner,
  body[data-printing="prices"] .page__sub,
  body[data-printing="prices"] .acct-tools,
  body[data-printing="prices"] .acct-head-actions,
  body[data-printing="prices"] .price-list__meta .link-btn,
  body[data-printing="prices"] .consent,
  body[data-printing="prices"] #consentBanner { display: none !important; }
  body[data-printing="prices"] .dash-layout { display: block; }
  body[data-printing="prices"] .page { padding: 0; max-width: none; }
  body[data-printing="prices"] .page__head::after {
    content: attr(data-print-for);
    display: block; margin-top: 0.25rem; color: #555; font-size: 10pt;
  }
  body[data-printing="prices"] .panel { border: 0; box-shadow: none; padding: 0; }
  body[data-printing="prices"] .table { font-size: 9.5pt; }
  body[data-printing="prices"] .table th, body[data-printing="prices"] .table td { padding: 0.3rem 0.4rem; }
  body[data-printing="prices"] tr { break-inside: avoid; }
}
.price-list__table th.table__num { text-align: right; }
