/* src/public/css/sales-reps-buyers.css: Sales Reps: Funnel buyers (js/sales-reps-buyers.js, srby-): the buyers table
   with its search, and one buyer's record (their orders, their answers under each question, their files). After
   sales-reps.css and sales-reps-manager.css, whose tokens and pieces (card, sr-tbl, sr-input, badge) it builds on. */

.srby-bar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--border-soft); }
.srby-search { display: flex; gap: 8px; align-items: center; flex: 1 1 320px; margin: 0; }
.srby-search .sr-input { flex: 1 1 auto; min-width: 0; max-width: 440px; padding: 8px 12px; }
.srby-pad { padding: 12px 16px; }
.srby-vh { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.srby-tbl tbody tr { cursor: pointer; }
.srby-tbl tbody tr:hover td { background: var(--surface-2); }
.srby-tbl tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.srby-tbl td[data-k="Buyer"] { min-width: 210px; max-width: 280px; }
.srby-name { font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.srby-email { overflow-wrap: anywhere; }
.srby-lines { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.srby-nowrap { white-space: nowrap; }
.srby-tbl .badge { white-space: nowrap; }

.srby-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 160px)); gap: 8px; margin: 0 0 16px; }
.srby-stat { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--border-soft); border-radius: 12px; padding: 10px 12px; }
.srby-stat .n { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 22px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.srby-stat .k { font-size: 13px; color: var(--text-2); }

.srby-order + .srby-order { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border-soft); }
.srby-ohead { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.srby-obadges { display: flex; gap: 6px; flex-wrap: wrap; }
.srby-items { border: 1px solid var(--border-soft); border-radius: 10px; }
.srby-total { margin: 8px 0 0; color: var(--text-2); }

.srby-sub { padding: 14px 16px; }
.srby-sub + .srby-sub { border-top: 1px solid var(--border-soft); }
.srby-dl { margin: 6px 0 0; display: flex; flex-direction: column; gap: 0; }
.srby-qa { display: grid; grid-template-columns: minmax(180px, 32%) 1fr; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border-soft); }
.srby-qa:first-child { border-top: 0; }
.srby-qa dt { font-size: 13.5px; color: var(--text-2); font-weight: 600; }
.srby-qa dd { margin: 0; min-width: 0; }
.srby-ans a { color: var(--accent); overflow-wrap: anywhere; }
.srby-ans { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 1.5; color: var(--text); }
.srby-file { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.srby-fname { overflow-wrap: anywhere; }

.srby-access { margin-top: 6px; }
.srby-access .badge { white-space: normal; }
.srby-shares { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 0; }
.srby-shares li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border-soft); flex-wrap: wrap; }
.srby-shares li:first-child { border-top: 0; }
.srby-share-none { margin: 0 0 12px; }
.srby-share-add { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.srby-share-add .sr-input { flex: 1 1 240px; max-width: 360px; padding: 8px 12px; }
.srby-share-note { margin: 10px 0 0; }

@media (max-width: 720px) {
  /* The table becomes one card per buyer, each cell with its column's name (the pattern Stripe and Shopify use on a phone). */
  .srby-tbl thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .srby-tbl table, .srby-tbl tbody, .srby-tbl tr, .srby-tbl td { display: block; width: 100%; box-sizing: border-box; }
  .srby-tbl tr { padding: 10px 14px; border-bottom: 1px solid var(--border-soft); }
  .srby-tbl tr:last-child { border-bottom: 0; }
  .srby-tbl td { border: 0; padding: 3px 0; }
  .srby-tbl td[data-k="Buyer"] { min-width: 0; max-width: none; }
  .srby-tbl td[data-k]:not([data-k="Buyer"])::before { content: attr(data-k); display: block; font-size: 13px; color: var(--text-3); }
  .srby-items thead { display: none; }
  .srby-items, .srby-items tbody, .srby-items tr, .srby-items td { display: block; width: 100%; box-sizing: border-box; }
  .srby-items tr { padding: 8px 12px; border-bottom: 1px solid var(--border-soft); }
  .srby-items tr:last-child { border-bottom: 0; }
  .srby-items td { border: 0; padding: 2px 0; }
  .srby-qa { grid-template-columns: 1fr; gap: 4px; }
  .srby-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .srby-search .sr-input { max-width: none; }
  .srby-share-add .sr-input { max-width: none; }
}
