/* Kupci page, the "N vaših kupaca" box on ad cards, the owner-message buttons and the
   tired-sellers reasons. Uses app.css tokens, so light and dark themes both work. */

:root {
  /* White text on both: 6.0:1 and 7.9:1. Same in dark mode (brand colours). */
  --viber: #665cac; --viber-hover: #5a5099;
  --wa: #075e54;    --wa-hover: #064e46;
}

/* ---------- On the ad card ---------- */
.tired-why { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tired-label { font-size: 12.5px; font-weight: 600; color: var(--text-subtle); }

.match-box { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--accent-soft); padding: var(--s2) var(--s3); margin-top: var(--s1); }
.match-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.match-badge { display: inline-flex; align-items: center; gap: var(--s2); min-height: 36px; border: 0; background: none; padding: 0; color: var(--accent-text); font-size: 14px; font-weight: 650; cursor: pointer; text-align: left; }
.match-badge:hover { text-decoration: underline; }
.match-badge .chev { transition: transform .15s var(--ease); }
.match-badge[aria-expanded="true"] .chev { transform: rotate(180deg); }
.match-actions { display: inline-flex; flex-wrap: wrap; gap: var(--s2); margin-left: auto; }
.match-list { list-style: none; margin: var(--s2) 0 0; padding: 0; display: flex; flex-direction: column; gap: var(--s2); }
.match-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px var(--s2); padding-top: var(--s2); border-top: 1px solid var(--border); }
.match-name { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: 14px; color: var(--text); }
.match-name:hover { color: var(--accent-text); text-decoration: underline; }
.match-why { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.match-box .chip { background: var(--surface); }
.match-box .chip.good { background: var(--good-soft); }
.match-box .chip.warn { background: var(--warn-soft); }

.btn.viber, .btn.wa { color: var(--on-accent); border-color: transparent; }
.btn.viber { background: var(--viber); }
.btn.viber:hover { background: var(--viber-hover); }
.btn.wa { background: var(--wa); }
.btn.wa:hover { background: var(--wa-hover); }
.sr-copy { position: fixed; top: 0; left: 0; width: 1px; height: 1px; opacity: 0; }

/* ---------- Kupci page ---------- */
.head-actions { flex-wrap: wrap; justify-content: flex-end; }
.buyer-form .row .input { min-width: 0; }
.input.area { height: auto; min-height: 76px; padding: 10px var(--s3); line-height: 1.5; resize: vertical; }
.input.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; white-space: pre; }
.checks { display: flex; flex-wrap: wrap; gap: 0 var(--s5); }
.form-buttons { padding-top: var(--s1); }

.tokens { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; padding: 5px var(--s2); border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.tokens:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.token { display: inline-flex; align-items: center; gap: 2px; height: 30px; padding: 0 4px 0 10px; border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent-text); font-size: 13.5px; font-weight: 600; }
.token button { display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; }
.token button:hover { background: var(--surface); }
.token-input { flex: 1 1 140px; min-width: 120px; height: 32px; border: 0; outline: none; background: none; font-size: 15px; color: var(--text); }
.token-input::placeholder { color: var(--text-subtle); }

.buyers-search { margin-left: auto; }
.buyers-search input { width: 240px; }
.buyers { display: flex; flex-direction: column; }
.buyer { display: flex; flex-wrap: wrap; gap: var(--s3) var(--s4); padding: var(--s4) 0; border-top: 1px solid var(--border); scroll-margin-top: 80px; }
.buyers .buyer:first-child { border-top: 0; padding-top: 0; }
.buyer.paused .buyer-main { opacity: 0.7; }
.buyer-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.buyer-name { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); font-size: 16px; font-weight: 650; }
.buyer-meta { color: var(--text-muted); font-size: 13.5px; }
.buyer-phone { display: inline-flex; align-items: center; gap: 4px; color: var(--accent-text); font-weight: 600; font-variant-numeric: tabular-nums; }
.buyer-notes { margin: 2px 0 0; color: var(--text-muted); font-size: 13.5px; white-space: pre-wrap; }
.buyer-actions { display: flex; align-items: flex-start; flex-wrap: wrap; gap: var(--s2); }
.new-dot { margin-left: 4px; padding: 0 6px; border-radius: var(--r-pill); background: rgba(255, 255, 255, 0.22); color: var(--on-accent); font-size: 12px; font-weight: 700; }
.buyer-matches { flex-basis: 100%; display: flex; flex-direction: column; gap: var(--s3); padding: var(--s3); border-radius: var(--r-lg); background: var(--tint); }
.empty-note { color: var(--text-subtle); padding: var(--s4) 0; }

.bm { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: var(--s3); padding: var(--s3); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-sm); }
.bm-photo { position: relative; display: grid; place-items: center; height: 84px; border-radius: var(--r-sm); overflow: hidden; background: var(--tint); color: var(--control); }
.bm-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bm-body { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.bm-head { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.bm-title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bm-title:hover { color: var(--accent-text); }
.bm-specs { color: var(--text-muted); font-size: 13.5px; }
.bm-others { display: flex; align-items: center; gap: 4px; color: var(--text-muted); font-size: 13px; }
.bm-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.bm-actions .open-link { margin-left: auto; }

.import-hint { line-height: 1.6; }
.import-sum { margin: var(--s4) 0 var(--s2); font-weight: 600; }
.u-table tr.bad-row td { color: var(--text-subtle); }
.u-table td { white-space: normal; }

.placeholders { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.chip.ph { border: 0; cursor: pointer; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.chip.ph:hover { background: var(--accent-soft); color: var(--accent-text); }
.preview { background: var(--tint); border-radius: var(--r-lg); padding: var(--s1) var(--s4) var(--s3); }
.preview .sub-title { display: block; margin-top: var(--s2); }
.preview p { margin: 0; white-space: pre-wrap; }

@media (max-width: 640px) {
  .match-actions { margin-left: 0; width: 100%; }
  .match-actions .btn { flex: 1 1 auto; }
  .head-actions { width: 100%; justify-content: stretch; }
  .head-actions .btn { flex: 1; }
  .page-head { flex-wrap: wrap; }
  .buyers-search { margin-left: 0; width: 100%; }
  .buyers-search input { width: 100%; }
  .bm { grid-template-columns: 1fr; }
  .bm-photo { height: 140px; }
  .bm-actions .btn { flex: 1 1 auto; }
  .bm-actions .open-link { margin-left: 0; flex-basis: 100%; justify-content: center; }
}
