.admin .brand-mark { box-shadow: 0 6px 18px rgba(244, 183, 64, 0.35) !important; }
.admin .portal-nav button.active { background: rgba(244,183,64,0.14); border-color: rgba(244,183,64,0.5); color: #ffd784; }

.admin-grid-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.user-detail {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 18px;
}
@media (max-width: 900px) {
  .user-detail { grid-template-columns: 1fr; }
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: rgba(120,140,180,0.15);
  color: var(--muted);
}

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal {
  background: var(--panel-strong);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  padding: 24px;
  width: min(520px, 100%);
  max-height: 90vh;
  overflow: auto;
}
.modal h2 { margin: 0 0 14px; font-size: 18px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }

/* ── Chat viewer ────────────────────────────────────────────────────── */
.webchats-layout { display: grid; grid-template-columns: 320px 1fr; gap: 16px; align-items: start; }
@media (max-width: 700px) { .webchats-layout { grid-template-columns: 1fr; } }

.webchat-sidebar { max-height: 75vh; overflow-y: auto; }
.webchat-item { padding: 12px; border-bottom: 1px solid var(--border, #e5e7eb); cursor: pointer; transition: background .12s; }
.webchat-item:hover { background: #f0f4ff; }
.webchat-item.selected { background: #e8f0fe; border-left: 3px solid #3b82f6; }
.webchat-item-sender { font-weight: 600; font-size: 14px; color: #111; }
.webchat-item-preview { font-size: 13px; color: #555; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.webchat-item-meta { font-size: 11px; color: #999; margin-top: 3px; }

.webchat-main { min-height: 400px; display: flex; flex-direction: column; }
.webchat-placeholder { padding: 48px; text-align: center; }
.webchat-transcript-head { padding: 12px 16px; border-bottom: 1px solid var(--border, #e5e7eb); display: flex; gap: 12px; align-items: center; flex-wrap: wrap; font-size: 13px; }
.webchat-transcript { flex: 1; overflow-y: auto; max-height: 60vh; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: #f8f9fa; }

.webchat-bubble { max-width: 72%; display: flex; flex-direction: column; }
.webchat-bubble.user { align-self: flex-start; }
.webchat-bubble.assistant { align-self: flex-end; }
.bubble-text { padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.webchat-bubble.user .bubble-text { background: #fff; border: 1px solid #e0e0e0; border-bottom-left-radius: 3px; }
.webchat-bubble.assistant .bubble-text { background: #2563eb; color: #fff; border-bottom-right-radius: 3px; }
.bubble-time { font-size: 10px; color: #999; margin-top: 3px; padding: 0 2px; }
.webchat-bubble.assistant .bubble-time { text-align: right; }
