/* ----------------------------------------------------
   SUBI CHAT DESIGN SYSTEM - MODERN DARK GLASSMORPHISM
---------------------------------------------------- */
:root {
  --bg-main: #0b0f19;
  --bg-sidebar: #111827;
  --bg-card: rgba(31, 41, 55, 0.6);
  --bg-card-hover: rgba(55, 65, 81, 0.5);
  --bg-input: #1f2937;
  --bg-bubble-sent: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  --bg-bubble-received: #1e293b;
  
  --border-color: rgba(255, 255, 255, 0.08);
  --border-focus: #38bdf8;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-cyan: #38bdf8;
  --accent-emerald: #10b981;
  --accent-violet: #818cf8;
  
  --status-sent: #94a3b8;
  --status-delivered: #94a3b8;
  --status-seen: #38bdf8; /* Blue ticks */

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 15px rgba(56, 189, 248, 0.25);

  --font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.25s cubic-bezier(0.16, 1, 0.3, 1);

  /* Safe Area Insets for iOS & Modern Mobile */
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
  --sar: env(safe-area-inset-right, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  height: 100dvh;
  width: 100%;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-primary);
  height: 100%;
  height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow: hidden;
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base App Layout */
.app-layout {
  display: flex;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-width: 1600px;
  background-color: var(--bg-sidebar);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

/* ====================================================
   SIDEBAR
==================================================== */
.sidebar {
  width: 380px;
  min-width: 320px;
  height: 100%;
  height: 100dvh;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: 10;
  transition: transform var(--transition-normal);
  overflow: hidden;
}

.sidebar-header {
  padding: max(14px, var(--sat)) 20px 14px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(15, 23, 42, 0.6);
  flex-shrink: 0;
}

.current-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.current-user-card:hover {
  background: var(--bg-card-hover);
}

.avatar-wrapper {
  position: relative;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: var(--radius-full);
  object-fit: cover;
  background: #1e293b;
  border: 2px solid rgba(255, 255, 255, 0.1);
}

.status-indicator {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--bg-sidebar);
  background-color: var(--text-muted);
}

.status-indicator.online {
  background-color: var(--accent-emerald);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
}

.user-meta {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-status-text {
  font-size: 12px;
  color: var(--accent-emerald);
  font-weight: 500;
}

.switch-user-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.switch-user-btn:hover {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* Sidebar Controls: Search & Tabs */
.sidebar-controls {
  padding: 12px 20px 8px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 12px;
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.search-box input {
  width: 100%;
  padding: 10px 36px 10px 38px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
  transition: all var(--transition-fast);
}

.search-box input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.clear-search {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 2px;
}

.clear-search:hover {
  color: var(--text-primary);
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  background: rgba(15, 23, 42, 0.7);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  gap: 4px;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 12px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn i {
  width: 16px;
  height: 16px;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
  background: #1e293b;
  color: var(--accent-cyan);
  box-shadow: var(--shadow-sm);
}

.tab-badge {
  background: var(--accent-cyan);
  color: #0f172a;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.tab-count {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* Lists Container */
.sidebar-list-container {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.tab-content {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.tab-content.active {
  display: flex;
}

.list-scroll {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 12px max(14px, var(--sab));
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Chat Item */
.chat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  cursor: pointer;
  background: transparent;
  transition: all var(--transition-fast);
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
}

.chat-item:hover {
  background: var(--bg-card-hover);
}

.chat-item.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.3);
}

.chat-item-content {
  flex: 1;
  min-width: 0;
}

.chat-item-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 3px;
}

.chat-item-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-time {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
  flex-shrink: 0;
}

.chat-item-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.chat-item-preview {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.chat-item-preview .preview-text {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-item-preview.unread {
  font-weight: 600;
  color: var(--text-primary);
}

.sidebar-typing-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #38bdf8;
  font-weight: 700;
  font-size: 12.5px;
  animation: pulseGlow 1.5s infinite ease-in-out;
}

.typing-dots-sm {
  display: inline-flex;
  align-items: center;
  gap: 2.5px;
}

.typing-dots-sm span {
  width: 4px;
  height: 4px;
  background: #38bdf8;
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots-sm span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots-sm span:nth-child(2) { animation-delay: -0.16s; }

.people-bio.typing-highlight {
  color: #38bdf8;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

.unread-badge {
  background: var(--accent-cyan);
  color: #042f2e;
  font-size: 11px;
  font-weight: 800;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* People Item */
.people-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: transparent;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.people-item:hover {
  background: var(--bg-card-hover);
}

.people-info-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.people-text {
  flex: 1;
  min-width: 0;
}

.people-name {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
}

.user-meta-bracket {
  font-size: 12px;
  font-weight: 500;
  color: #38bdf8;
  opacity: 0.9;
  background: rgba(56, 189, 248, 0.1);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(56, 189, 248, 0.2);
}

.people-bio {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.people-actions-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.people-action-btn {
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.2);
  color: var(--accent-cyan);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.people-action-btn:hover {
  background: var(--accent-cyan);
  color: #0f172a;
}

.people-remove-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  opacity: 0.6;
}

.people-item:hover .people-remove-btn {
  opacity: 1;
}

.people-remove-btn:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.3);
  color: #f87171;
}

.people-remove-btn i {
  width: 14px;
  height: 14px;
}

/* Status Icons */
.status-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  vertical-align: middle;
}

.status-tick i {
  width: 14px;
  height: 14px;
}

.status-tick.sent {
  color: var(--status-sent);
}

.status-tick.delivered {
  color: var(--status-delivered);
}

.status-tick.seen {
  color: var(--status-seen); /* Vibrant blue ticks */
}

/* ====================================================
   MAIN CHAT CONTAINER
==================================================== */
.chat-container {
  flex: 1;
  height: 100%;
  height: 100dvh;
  min-height: 0;
  min-width: 0;
  background: #0d131f;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

/* Empty State */
.empty-chat-state {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px;
}

.empty-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-icon-bubble {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-cyan);
  margin-bottom: 8px;
}

.empty-icon-bubble i {
  width: 40px;
  height: 40px;
}

.empty-content h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
}

.empty-content p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.features-pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 12px 0;
}

.feature-pill {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.feature-pill.seen-pill {
  border-color: rgba(56, 189, 248, 0.3);
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.08);
}

.cta-start-chat-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  transition: all var(--transition-fast);
}

.cta-start-chat-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.4);
}

/* Active Chat Section */
.active-chat {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  position: relative;
  background: radial-gradient(circle at 50% 0%, rgba(30, 41, 59, 0.35), transparent 70%), #0d131f;
}

/* Chat Header */
.chat-header {
  min-height: 60px;
  height: auto;
  padding: max(10px, var(--sat)) 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  z-index: 5;
  flex-shrink: 0;
}

.chat-recipient-info {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
}

.mobile-back-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 4px;
}

.recipient-details {
  display: flex;
  flex-direction: column;
}

.recipient-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

.recipient-status-row {
  display: flex;
  align-items: center;
  font-size: 12px;
}

.status-subtitle {
  color: var(--text-muted);
}

.status-subtitle.online {
  color: var(--accent-emerald);
  font-weight: 600;
}

.typing-subtitle {
  color: var(--accent-cyan);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.typing-dots {
  display: inline-flex;
  gap: 3px;
}

.typing-dots span {
  width: 4px;
  height: 4px;
  background: var(--accent-cyan);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }

@keyframes typingBounce {
  0%, 80%, 100% { transform: scale(0); }
  40% { transform: scale(1); }
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.header-action-btn:hover {
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

/* Chat Inner Search */
.chat-inner-search {
  padding: 10px 20px;
  background: #1e293b;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-inner-search input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13.5px;
  outline: none;
}

.chat-inner-search button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

/* Messages Container */
.messages-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.date-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 8px 0;
}

.date-divider span {
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 600;
  padding: 4px 14px;
  border-radius: var(--radius-full);
}

.messages-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Message Bubble */
.message-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 75%;
  animation: messageAppear 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes messageAppear {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.message-row.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message-row.received {
  align-self: flex-start;
}

.message-bubble {
  padding: 10px 14px 8px;
  border-radius: var(--radius-lg);
  position: relative;
  box-shadow: var(--shadow-sm);
  word-wrap: break-word;
  word-break: break-word;
  max-width: 100%;
}

.message-row.sent .message-bubble {
  background: var(--bg-bubble-sent);
  color: #ffffff;
  border-bottom-right-radius: 4px;
}

.message-row.received .message-bubble {
  background: var(--bg-bubble-received);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-bottom-left-radius: 4px;
}

.message-text {
  font-size: 14.5px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.message-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  margin-top: 4px;
}

.message-time {
  font-size: 10.5px;
  opacity: 0.75;
  font-weight: 500;
}

/* Animated Tick Transitions */
.message-status-tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease, transform 0.2s ease;
}

.message-status-tick i {
  width: 15px;
  height: 15px;
}

.message-status-tick.status-pending,
.message-status-tick.status-sent {
  color: rgba(255, 255, 255, 0.65);
}

.message-status-tick.status-pending i,
.message-status-tick.status-sent i {
  width: 12px;
  height: 12px;
  stroke-width: 2.2;
}

.message-status-tick.status-delivered {
  color: rgba(255, 255, 255, 0.85);
}

.message-status-tick.status-seen {
  color: #38bdf8; /* Blue double ticks */
  filter: drop-shadow(0 0 4px rgba(56, 189, 248, 0.6));
}

.spin-icon {
  animation: spinLoader 1.2s linear infinite;
  display: inline-block;
  transform-origin: center;
}

@keyframes spinLoader {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Typing Bubble in Chat Area */
.typing-bubble-container {
  align-self: flex-start;
  margin-top: 4px;
}

.typing-bubble {
  background: var(--bg-bubble-received);
  border: 1px solid var(--border-color);
  padding: 10px 16px;
  border-radius: var(--radius-lg);
  border-bottom-left-radius: 4px;
  display: flex;
  gap: 4px;
}

.typing-bubble span {
  width: 6px;
  height: 6px;
  background: var(--text-muted);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite ease-in-out both;
}

.typing-bubble span:nth-child(1) { animation-delay: -0.32s; }
.typing-bubble span:nth-child(2) { animation-delay: -0.16s; }

/* Chat Input Bar */
.chat-input-bar {
  padding: 10px 20px max(14px, var(--sab));
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  z-index: 10;
}

.quick-emojis {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
  flex-shrink: 0;
}

.quick-emojis::-webkit-scrollbar {
  display: none;
}

.quick-emoji {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 4px 8px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.quick-emoji:hover {
  background: rgba(255, 255, 255, 0.12);
  transform: scale(1.15);
}

.input-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-wrapper {
  flex: 1;
  position: relative;
}

.input-wrapper input {
  width: 100%;
  padding: 14px 20px;
  background: #1f2937;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14.5px;
  outline: none;
  transition: all var(--transition-fast);
}

.input-wrapper input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.send-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: none;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
  flex-shrink: 0;
}

.send-btn:disabled {
  background: #334155;
  color: #64748b;
  box-shadow: none;
  cursor: not-allowed;
}

.send-btn:not(:disabled):hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(2, 132, 199, 0.45);
}

.send-btn:not(:disabled):active {
  transform: scale(0.95);
}

/* ====================================================
   MODALS
==================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.hidden {
  display: none;
}

.modal-card {
  background: #111827;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-close-btn:hover {
  color: var(--text-primary);
}

.user-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.user-select-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #1e293b;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-select-card:hover {
  background: rgba(56, 189, 248, 0.1);
  border-color: var(--accent-cyan);
}

.user-select-card.active-user {
  border-color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
}

.user-select-card .avatar-wrapper {
  width: 36px;
  height: 36px;
}

.user-select-name {
  font-size: 13.5px;
  font-weight: 600;
}

.user-select-tag {
  font-size: 11px;
  color: var(--text-muted);
}

.create-custom-user {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
}

.create-custom-user h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.create-user-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.create-user-form input {
  padding: 10px 14px;
  background: #1f2937;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 13px;
  outline: none;
}

.create-user-form input:focus {
  border-color: var(--accent-cyan);
}

.btn-primary {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.btn-primary:hover {
  filter: brightness(1.1);
}

/* Utilities */
.hidden {
  display: none !important;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ====================================================
   GUEST LOGIN SCREEN DESIGN
==================================================== */
.guest-login-screen {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  background-color: #080c14;
  background-image: 
    radial-gradient(at 0% 0%, rgba(2, 132, 199, 0.22) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.18) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(56, 189, 248, 0.08) 0px, transparent 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: max(16px, var(--sat)) 16px max(16px, var(--sab));
  z-index: 200;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.guest-card {
  margin: auto 0;
  background: rgba(17, 24, 39, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 100%;
  max-width: 460px;
  padding: 32px 28px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.7), 0 0 30px rgba(56, 189, 248, 0.12);
  display: flex;
  flex-direction: column;
  gap: 22px;
  animation: guestCardIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes guestCardIn {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.guest-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 4px;
}

.brand-icon {
  color: var(--accent-cyan);
  display: flex;
  align-items: center;
}

.brand-icon i {
  width: 18px;
  height: 18px;
}

.brand-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent-cyan);
  letter-spacing: 0.5px;
}

.guest-welcome-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.5px;
}

.guest-welcome-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  max-width: 340px;
}

.guest-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Avatar Section */
.avatar-picker-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}

.avatar-preview-wrapper {
  position: relative;
  width: 88px;
  height: 88px;
}

.guest-avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.35);
  background: #1e293b;
  transition: transform var(--transition-fast);
}

.guest-avatar-img:hover {
  transform: scale(1.05);
}

.avatar-dice-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  border: 2px solid #111827;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform var(--transition-fast);
}

.avatar-dice-btn:hover {
  transform: scale(1.15) rotate(15deg);
}

.avatar-hint {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Form Groups */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.form-group label i {
  width: 14px;
  height: 14px;
  color: var(--accent-cyan);
}

.form-group input[type="text"] {
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.form-group input[type="text"]:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

/* Gender Pills */
.gender-pill-group {
  display: flex;
  gap: 8px;
}

.gender-pill-label {
  flex: 1;
  cursor: pointer;
}

.gender-radio {
  display: none;
}

.gender-pill-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
  transition: all var(--transition-fast);
}

.gender-pill-label:hover .gender-pill-content {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.gender-radio:checked + .gender-pill-content {
  background: rgba(56, 189, 248, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.25);
}

/* Age Input */
.age-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.age-input-wrapper input {
  width: 100%;
  padding: 12px 100px 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 14px;
  outline: none;
  transition: all var(--transition-fast);
}

.age-input-wrapper input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.2);
}

.age-suffix {
  position: absolute;
  right: 16px;
  font-size: 12.5px;
  color: var(--text-muted);
  pointer-events: none;
  font-weight: 500;
}

/* Submit Button */
.guest-submit-btn {
  background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  margin-top: 4px;
  box-shadow: 0 6px 20px rgba(2, 132, 199, 0.35);
  transition: all var(--transition-fast);
}

.guest-submit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(2, 132, 199, 0.5);
  filter: brightness(1.05);
}

.guest-submit-btn:active {
  transform: translateY(0);
}

.guest-submit-btn i {
  width: 18px;
  height: 18px;
}

/* Demo Section */
.guest-demo-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  text-align: center;
}

.demo-divider-text {
  font-size: 11.5px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.demo-user-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.demo-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.demo-chip img {
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.demo-chip:hover {
  background: rgba(56, 189, 248, 0.12);
  border-color: var(--accent-cyan);
  color: var(--text-primary);
  transform: scale(1.04);
}

/* Header Action Buttons */
.user-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.guest-tag {
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.3);
  color: var(--accent-emerald);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

.header-action-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.logout-btn {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #f87171;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  border-color: #f87171;
  color: #ffffff;
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
}

/* Responsive */
/* Responsive */
@media (max-width: 768px) {
  html, body {
    height: 100%;
    height: 100dvh;
    width: 100%;
    overflow: hidden;
    position: fixed;
    inset: 0;
  }

  .app-layout {
    width: 100%;
    height: 100%;
    height: 100dvh;
    max-width: 100%;
    border-radius: 0;
    box-shadow: none;
    overflow: hidden;
  }

  .sidebar {
    width: 100%;
    min-width: 100%;
    height: 100%;
    height: 100dvh;
    border-right: none;
  }

  .sidebar-header {
    padding: max(10px, var(--sat)) 16px 10px;
  }

  .sidebar-controls {
    padding: 10px 14px 6px;
    gap: 10px;
  }

  .tab-btn {
    padding: 8px 10px;
    font-size: 12.5px;
  }

  .list-scroll {
    padding: 6px 10px max(12px, var(--sab));
  }

  .chat-container {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    height: 100dvh;
    min-height: 0;
    transform: translateX(100%);
    transition: transform var(--transition-normal);
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .chat-container.active-mobile {
    transform: translateX(0);
  }

  .active-chat {
    height: 100%;
    height: 100dvh;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .chat-header {
    min-height: 56px;
    height: auto;
    padding: max(8px, var(--sat)) 12px 8px;
    gap: 8px;
    flex-shrink: 0;
  }

  .mobile-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    flex-shrink: 0;
  }

  .mobile-back-btn:active {
    background: rgba(56, 189, 248, 0.2);
    color: var(--accent-cyan);
  }

  .chat-recipient-info {
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  .recipient-name {
    font-size: 14.5px;
  }

  .messages-container {
    padding: 12px 12px;
    gap: 10px;
    min-height: 0;
  }

  .message-row {
    max-width: 88%;
  }

  .message-text {
    font-size: 14px;
  }

  .chat-input-bar {
    padding: 8px 12px max(10px, var(--sab));
    gap: 6px;
    flex-shrink: 0;
  }

  .input-wrapper input {
    padding: 10px 14px;
    font-size: 14px;
  }

  .send-btn {
    width: 42px;
    height: 42px;
  }

  .guest-login-screen {
    padding: max(14px, var(--sat)) 14px max(14px, var(--sab));
  }

  .guest-card {
    padding: 22px 18px;
    border-radius: 20px;
    gap: 16px;
  }

  .guest-welcome-title {
    font-size: 20px;
  }

  .guest-welcome-subtitle {
    font-size: 12px;
  }

  .avatar-preview-wrapper {
    width: 76px;
    height: 76px;
  }

  .form-group input[type="text"],
  .age-input-wrapper input {
    padding: 10px 14px;
    font-size: 13.5px;
  }

  .guest-submit-btn {
    padding: 12px 16px;
    font-size: 14px;
  }

  .modal-card {
    padding: 18px 16px max(18px, var(--sab));
    max-height: calc(100dvh - 32px);
    border-radius: 18px;
  }
}

/* ====================================================
   ADMIN CONSOLE & CHAT HISTORY INSPECTOR STYLES
==================================================== */

.guest-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 8px;
}

.guest-admin-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.guest-admin-btn:hover {
  background: #fbbf24;
  color: #0f172a;
}

.admin-panel-btn {
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-panel-btn:hover {
  background: #fbbf24;
  color: #0f172a;
  transform: translateY(-1px);
}

.admin-modal-card {
  max-width: 860px;
  width: 95%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}

.admin-modal-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

.admin-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-badge-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fbbf24;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.admin-stats-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.admin-stat-pill {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.admin-stat-pill i {
  width: 18px;
  height: 18px;
  color: #fbbf24;
}

.admin-stat-val {
  font-weight: 700;
  color: var(--text-primary);
  margin-left: auto;
  font-size: 14px;
}

.admin-filter-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 14px;
}

.admin-filter-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-filter-title i {
  color: #38bdf8;
  width: 16px;
  height: 16px;
}

.admin-dropdowns-row {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.admin-select-field {
  flex: 1;
  min-width: 220px;
}

.admin-select-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.admin-select-input {
  width: 100%;
  background: rgba(30, 41, 59, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: inherit;
  font-size: 13px;
  outline: none;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-select-input:focus {
  border-color: #fbbf24;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.2);
}

.admin-select-input option {
  background: #0f172a;
  color: #f8fafc;
}

.admin-swap-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  color: var(--text-muted);
}

.admin-action-col {
  min-width: 160px;
}

.admin-fetch-btn {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  border: none;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  width: 100%;
  transition: all var(--transition-fast);
}

.admin-fetch-btn:hover {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}

.admin-quick-threads-section {
  margin-bottom: 16px;
}

.admin-threads-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.admin-section-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-threads-count {
  font-size: 11px;
  color: var(--accent-cyan);
  font-weight: 600;
}

.admin-threads-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.admin-thread-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  padding: 5px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.admin-thread-chip:hover {
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
  color: #fbbf24;
}

.admin-thread-chip.active {
  background: rgba(245, 158, 11, 0.25);
  border-color: #fbbf24;
  color: #ffffff;
  font-weight: 600;
}

.admin-chip-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--radius-full);
}

/* History Viewer */
.admin-history-viewer {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 260px;
  max-height: 380px;
}

.admin-history-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  background: rgba(30, 41, 59, 0.5);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.admin-history-title-wrap h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-primary);
}

.admin-history-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.admin-refresh-btn {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.admin-refresh-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
}

.admin-messages-scroll {
  padding: 16px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.admin-empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.admin-empty-state i {
  width: 36px;
  height: 36px;
  margin-bottom: 10px;
  opacity: 0.4;
}

/* Individual Admin Log Message Row */
.admin-log-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background var(--transition-fast);
}

.admin-log-row:hover {
  background: rgba(255, 255, 255, 0.05);
}

.admin-log-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border-color);
}

.admin-log-content {
  flex: 1;
  min-width: 0;
}

.admin-log-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.admin-log-sender {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-cyan);
}

.admin-log-arrow {
  color: var(--text-muted);
  font-size: 11px;
  margin: 0 4px;
}

.admin-log-receiver {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.admin-log-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: monospace;
}

.admin-log-text {
  font-size: 13.5px;
  color: var(--text-primary);
  line-height: 1.45;
  word-break: break-word;
  background: rgba(15, 23, 42, 0.4);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-cyan);
}

.admin-log-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-top: 6px;
}

.admin-log-status-badge.seen {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.admin-log-status-badge.delivered {
  background: rgba(148, 163, 184, 0.15);
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.3);
}

.admin-log-status-badge.sent {
  background: rgba(100, 116, 139, 0.15);
  color: #94a3b8;
  border: 1px solid rgba(100, 116, 139, 0.3);
}


