/* ═══════════════════════════════════════════════════════════════════
   Support Admin Styling (css/support.css)
   ═══════════════════════════════════════════════════════════════════ */

.support-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 120px);
  gap: var(--s4);
}

.support-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s3);
  padding-bottom: var(--s3);
  border-bottom: 1px solid var(--border);
}

.support-layout {
  display: flex;
  flex: 1;
  min-height: 0;
  gap: var(--s4);
}

/* ── Inbox List ── */
.ticket-list {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.ticket-item {
  padding: var(--s3);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.2s;
}

.ticket-item:hover, .ticket-item.active {
  background: rgba(255,255,255,0.03);
}
.ticket-item.active {
  border-left: 3px solid var(--primary);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--s2);
}

.ticket-subject {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.ticket-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: var(--s2);
  align-items: center;
}

.badge {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
}
.badge-open { background: rgba(59,130,246,0.2); color: #60a5fa; }
.badge-in_progress { background: rgba(245,158,11,0.2); color: #fbbf24; }
.badge-resolved { background: rgba(16,185,129,0.2); color: #34d399; }
.badge-closed { background: rgba(107,114,128,0.2); color: #9ca3af; }
.badge-reopened { background: rgba(239,68,68,0.2); color: #f87171; }

.priority-high, .priority-urgent { color: #f87171; }
.priority-low { color: #9ca3af; }

/* ── Thread View ── */
.ticket-detail {
  flex: 2;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.detail-header {
  padding: var(--s4);
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
}

.detail-actions {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s3);
}

.thread-view {
  flex: 1;
  padding: var(--s4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
}

.message {
  display: flex;
  flex-direction: column;
  max-width: 85%;
}

.msg-agent { align-self: flex-end; }
.msg-user { align-self: flex-start; }
.msg-internal { align-self: center; width: 100%; max-width: 100%; }

.msg-bubble {
  padding: var(--s3);
  border-radius: var(--r2);
  background: var(--border);
  color: var(--text);
  line-height: 1.5;
  white-space: pre-wrap;
}

.msg-agent .msg-bubble {
  background: rgba(59, 130, 246, 0.2);
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.msg-internal .msg-bubble {
  background: rgba(245, 158, 11, 0.15);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: #fcd34d;
}

.msg-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
  display: flex;
  gap: var(--s2);
}
.msg-agent .msg-meta { justify-content: flex-end; }
.msg-internal .msg-meta { justify-content: center; }

/* ── Reply Box ── */
.reply-box {
  padding: var(--s3);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.reply-tabs {
  display: flex;
  gap: var(--s2);
  margin-bottom: var(--s2);
}
.reply-tab {
  padding: 4px 12px;
  font-size: 12px;
  cursor: pointer;
  border-radius: var(--r1);
  color: var(--text-muted);
}
.reply-tab.active {
  background: var(--border);
  color: var(--text);
}
.reply-tab-internal.active {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

textarea.reply-input {
  width: 100%;
  background: rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  border-radius: var(--r1);
  color: var(--text);
  padding: var(--s2);
  min-height: 80px;
  resize: vertical;
  margin-bottom: var(--s2);
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--s2);
}
