/* Buyer Portal admin: Messages panel (deals-portal messaging Phase 2). Loaded
   only by admin.html; uses the tokens defined in styles.css. */
.msgs { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.msgs.hidden { display: none; }
.msgs-body { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 14px; min-height: 420px; }
.msgs .admin-head { flex-wrap: wrap; }
.msgs-list, .msgs-item, .msgs-row1, .msgs-row2 { min-width: 0; }
.msgs-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); max-height: 620px; overflow-y: auto; }
.msgs-item { padding: 10px 12px; border-bottom: 1px solid var(--line); cursor: pointer; }
.msgs-item:hover { background: #f7faf8; }
.msgs-item.open { background: #eef7f2; box-shadow: inset 3px 0 0 var(--green); }
.msgs-row1 { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.msgs-name { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs-when { font-size: 12px; color: var(--muted); white-space: nowrap; }
.msgs-row2 { display: flex; gap: 6px; margin-top: 2px; font-size: 13px; color: var(--muted); }
.msgs-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs-dot { color: var(--green-dark); font-size: 10px; line-height: 18px; }
.msgs-tag { margin-top: 4px; font-size: 11px; color: var(--muted); }
.msgs-empty { padding: 14px; }
.msgs-thread { border: 1px solid var(--line); border-radius: 8px; background: var(--card); display: flex; flex-direction: column; min-width: 0; }
.msgs-thead { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.msgs-tname { font-weight: 700; font-size: 16px; color: var(--navy); }
.msgs-thead a { color: var(--green-dark); }
.msgs-scroll { flex: 1; overflow-y: auto; max-height: 560px; padding: 14px; background: var(--bg); display: flex; flex-direction: column; gap: 8px; }
.msgs-bubble { max-width: 72%; padding: 8px 11px; border-radius: 12px; font-size: 14px; line-height: 1.35; }
.msgs-bubble.in { align-self: flex-start; background: #fff; border: 1px solid var(--line); }
.msgs-bubble.out { align-self: flex-end; background: #e2f3ea; border: 1px solid #c6e6d4; }
.msgs-text { white-space: pre-wrap; word-wrap: break-word; }
.msgs-meta { margin-top: 3px; font-size: 11px; color: var(--muted); }
.msgs-compose { border-top: 1px solid var(--line); padding: 10px 12px; }
.msgs-compose textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 14px; resize: vertical; }
.msgs-compose textarea:focus { outline: none; border-color: var(--green); }
.msgs-compose-row { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.msgs-compose .login-msg { margin-top: 6px; }
.msgs-optout { padding: 10px 12px; border-top: 1px solid var(--line); }
.msgs .admin-tools .btn + .btn { margin-left: 6px; }
.msgs-modal { width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); border: 1px solid var(--line); border-radius: 10px; padding: 18px 18px 14px; position: relative; }
.msgs-modal::backdrop { background: rgba(20, 30, 25, .35); }
.msgs-x { position: absolute; top: 8px; right: 10px; border: 0; background: none; font-size: 22px; cursor: pointer; color: var(--muted); }
.msgs-pick-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 10px 0; }
.msgs-pick-tools input[type=search] { flex: 1 1 220px; border: 1px solid var(--line); border-radius: 6px; padding: 7px 10px; font: inherit; }
.msgs-roster { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; max-height: 50vh; overflow-y: auto; }
.msgs-roster li { padding: 7px 10px; border-bottom: 1px solid var(--line); display: flex; gap: 8px; align-items: center; }
/* styles.css sets every `dialog label` to a vertical stack; keep roster rows on one line. */
.msgs-modal .msgs-roster li label { display: flex; flex-direction: row; gap: 10px; align-items: center; width: 100%; cursor: pointer; font-weight: 400; font-size: 14px; }
.msgs-modal .msgs-roster input[type=checkbox] { width: 17px; height: 17px; margin: 0; flex: 0 0 auto; accent-color: var(--green); }
.msgs-modal .msgs-roster .muted { white-space: nowrap; }
.msgs-modal .check-row { display: flex; flex-direction: row; align-items: center; gap: 6px; font-weight: 400; }
.msgs-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 10px; }
.msgs-chip { display: inline-flex; align-items: center; gap: 4px; background: #eef7f2; border: 1px solid #c6e6d4; color: var(--ink); border-radius: 999px; padding: 3px 4px 3px 10px; font-size: 13px; font-weight: 600; }
.msgs-chip button { border: 0; background: none; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted); padding: 0 4px; }
.msgs-chip button:hover { color: var(--red); }
.msgs-clear { border: 0; background: none; color: var(--green-dark); text-decoration: underline; cursor: pointer; font-size: 13px; }
.msgs-roster li.off { opacity: .55; }
.msgs-rname { font-weight: 600; flex: 1; min-width: 0; }
.msgs-pick-foot { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; gap: 8px; }
.msgs-modal textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font: inherit; font-size: 14px; }
.msgs-preview-box { margin-top: 10px; display: flex; flex-direction: column; gap: 4px; }
.msgs-preview-box .msgs-bubble { max-width: 100%; }
.msgs-st { font-size: 12px; font-weight: 600; }
.msgs-st.sent { color: var(--green-dark); }
.msgs-st.failed { color: var(--red); }
.msgs-st.queued { color: var(--muted); }
.msgs-media { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.msgs-media img { display: block; max-width: 220px; max-height: 260px; border-radius: 8px; border: 1px solid var(--line); object-fit: cover; background: #fff; }
.msgs-media-wait { font-size: 12px; color: var(--muted); font-style: italic; }
.msgs-rowbtn { margin-right: 6px; }
.msgs-rowbtn:disabled { opacity: .45; cursor: not-allowed; }
.msgs-rowdlg { width: min(720px, calc(100vw - 32px)); padding: 14px; }
.msgs-rowdlg .msgs-thread { border: 0; }
.msgs-rowdlg .msgs-thead { padding-right: 36px; }
.msgs-rowdlg .msgs-scroll { max-height: 52vh; min-height: 160px; }
.msgs-rowcall { margin-right: 6px; }
.msgs-callbtn { vertical-align: middle; }
.msgs-call { align-self: center; font-size: 13px; color: var(--muted); background: #f1f4f2; border: 1px dashed var(--line); border-radius: 12px; padding: 6px 12px; text-align: center; }
.msgs-call .msgs-meta { text-align: center; }
.msgs-call a { color: var(--green-dark); }
.msgs-call-ico { color: var(--green-dark); }
/* Zoom phone dock: floating box in the corner (Phase 4) */
.msgs-dock { position: fixed; right: 16px; bottom: 16px; z-index: 40; width: 370px; max-width: calc(100vw - 32px); background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 24px rgba(20, 30, 25, .18); overflow: hidden; }
.msgs-dock-bar { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--navy); color: #fff; }
.msgs-dock-title { font-weight: 700; cursor: pointer; white-space: nowrap; }
.msgs-dock-status { flex: 1; font-size: 12px; color: #d6e2dc !important; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msgs-dock-toggle { border: 0; background: none; color: #fff; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 4px; }
.msgs-dock-body { height: 600px; max-height: calc(100vh - 120px); }
.msgs-dock-body iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.msgs-dock-min { width: 260px; }
.msgs-dock-min .msgs-dock-body { height: 0; }
@media (max-width: 760px) {
  .msgs-body { grid-template-columns: minmax(0, 1fr); }
  .msgs .admin-tools { width: 100%; justify-content: space-between; }
  .msgs-list { max-height: 300px; }
  .msgs-bubble { max-width: 88%; }
}
