.chat-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}
.chat-status-toggle {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
  font-size: 13px;
  color: var(--gray);
}
.chat-status-toggle:hover {
  background: rgba(255,255,255,0.1);
}
.chat-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.chat-status-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,0.5); }
.chat-status-dot.away { background: #eab308; box-shadow: 0 0 6px rgba(234,179,8,0.5); }
.chat-status-dot.invisible { background: #6b7280; }
.chat-status-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  overflow: hidden;
  z-index: 200;
  min-width: 160px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.chat-status-dropdown.open { display: block; }
.chat-status-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray);
  transition: var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.chat-status-option:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
}
.chat-status-option.active {
  color: #fff;
  background: rgba(255,255,255,0.05);
}
.chat-badge-wrap {
  position: relative;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.chat-badge-wrap:hover { background: rgba(255,255,255,0.1); }
.chat-badge-wrap svg { color: var(--gray); }
.chat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
.chat-badge.hidden { display: none; }
.chat-badge.pulse {
  animation: badgePulse 1s ease-in-out infinite;
}
@keyframes badgePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}
.chat-requests-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  z-index: 200;
  min-width: 300px;
  max-width: 360px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  max-height: 400px;
  overflow-y: auto;
}
.chat-requests-dropdown.open { display: block; }
.chat-requests-title {
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--gray);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.chat-request-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
  cursor: pointer;
  transition: var(--transition);
}
.chat-request-item:hover { background: rgba(255,255,255,0.06); }
.chat-request-item:last-child { border-bottom: none; }
.chat-request-name {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
}
.chat-request-meta {
  font-size: 12px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-request-waiting {
  color: var(--orange);
  font-weight: 600;
}
.chat-no-requests {
  padding: 20px 16px;
  text-align: center;
  color: var(--gray);
  font-size: 13px;
}
.chat-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background: var(--navy-light);
  border: 1px solid var(--orange);
  border-radius: 12px;
  padding: 16px 20px;
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: toastSlide 0.3s ease-out;
  max-width: 360px;
  cursor: pointer;
}
.chat-toast:hover { border-color: var(--red); }
@keyframes toastSlide {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.chat-toast-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-toast-content { flex: 1; }
.chat-toast-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}
.chat-toast-sub {
  font-size: 12px;
  color: var(--gray);
}
.chat-toast-close {
  background: none;
  border: none;
  color: var(--gray);
  cursor: pointer;
  font-size: 18px;
  padding: 0 4px;
}

.chat-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9000;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(4px);
}
.chat-modal-overlay.active {
  display: flex;
}
.chat-modal {
  width: 90vw;
  max-width: 720px;
  height: 85vh;
  max-height: 700px;
  background: var(--navy);
  border-radius: 16px;
  border: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.chat-modal-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.chat-modal-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  flex-shrink: 0;
}
.chat-modal-header-info {
  flex: 1;
  min-width: 0;
}
.chat-modal-header-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chat-modal-header-meta {
  font-size: 12px;
  color: var(--gray);
  display: flex;
  align-items: center;
  gap: 8px;
}
.chat-modal-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}
.chat-modal-status.new { background: rgba(234,179,8,0.15); color: #eab308; }
.chat-modal-status.open { background: rgba(239,68,68,0.15); color: #ef4444; }
.chat-modal-status.pending { background: rgba(59,130,246,0.15); color: #3b82f6; }
.chat-modal-status.solved { background: rgba(34,197,94,0.15); color: #22c55e; }
.chat-modal-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.chat-modal-zd-link {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  color: var(--gray);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.08);
  transition: var(--transition);
}
.chat-modal-zd-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.06);
}
.chat-modal-close {
  background: none;
  border: none;
  color: var(--gray);
  font-size: 22px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: var(--transition);
}
.chat-modal-close:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}
.chat-modal-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-modal-msg {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
  word-wrap: break-word;
}
.chat-modal-msg.customer {
  align-self: flex-start;
  background: var(--navy-light);
  border-bottom-left-radius: 4px;
  color: var(--white);
}
.chat-modal-msg.agent {
  align-self: flex-end;
  background: rgba(255,127,48,0.15);
  border: 1px solid rgba(255,127,48,0.2);
  border-bottom-right-radius: 4px;
  color: var(--white);
}
.chat-modal-msg-author {
  font-size: 11px;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--gray);
}
.chat-modal-msg.agent .chat-modal-msg-author {
  color: var(--orange);
  text-align: right;
}
.chat-modal-msg-time {
  font-size: 10px;
  color: var(--gray-dark);
  margin-top: 4px;
}
.chat-modal-msg.agent .chat-modal-msg-time {
  text-align: right;
}
.chat-modal-msg a {
  color: var(--orange);
}
.chat-modal-msg-system {
  align-self: center;
  font-size: 12px;
  color: var(--gray);
  background: rgba(255,255,255,0.04);
  padding: 6px 16px;
  border-radius: 20px;
}
.chat-modal-reply {
  padding: 12px 16px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
.chat-modal-reply input {
  flex: 1;
  padding: 12px 16px;
  background: var(--navy-light);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 10px;
  color: var(--white);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  outline: none;
  transition: var(--transition);
}
.chat-modal-reply input:focus {
  border-color: var(--orange);
}
.chat-modal-reply input::placeholder {
  color: var(--gray-dark);
}
.chat-modal-reply button {
  padding: 10px 20px;
  background: var(--orange);
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}
.chat-modal-reply button:hover {
  opacity: 0.9;
}
.chat-modal-reply button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.chat-modal-loading {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gray);
  font-size: 14px;
}
.chat-modal-poll-indicator {
  height: 2px;
  background: transparent;
  flex-shrink: 0;
  overflow: hidden;
}
.chat-modal-poll-indicator.active {
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  animation: chatPollSlide 1.5s ease-in-out infinite;
}
@keyframes chatPollSlide {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
