* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  color: #ffffff;
  background: #0f1419;
  overflow: hidden;
}

.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

.sidebar {
  width: 256px;
  background: #1a1f2e;
  border-right: 1px solid #374151;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 32px;
  height: 32px;
  color: #14b8a6;
  stroke-width: 2;
}

.sidebar-header h1 {
  font-size: 18px;
  font-weight: 600;
}

.sidebar-nav {
  flex: 1;
  padding: 0 12px;
  overflow-y: auto;
}

.nav-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
}

.nav-item:hover {
  background: rgba(55, 65, 81, 0.5);
}

.nav-item.active {
  background: #1f2937;
  color: #14b8a6;
  border-left: 2px solid #14b8a6;
}

.nav-item .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.nav-item span {
  flex: 1;
  text-align: left;
}

.nav-item .chevron {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.nav-subitem {
  padding: 8px 0 8px 48px;
  font-size: 14px;
  color: #9ca3af;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-nav {
  background: #1a1f2e;
  border-bottom: 1px solid #374151;
}

.top-nav > div {
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 16px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px;
  color: #9ca3af;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
}

.tab:hover {
  color: #d1d5db;
}

.tab.active {
  background: rgba(20, 184, 166, 0.2);
  color: #14b8a6;
  border-color: #14b8a6;
}

.tab .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ef4444;
  color: white;
  font-size: 12px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.settings-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.settings-btn:hover {
  background: #1f2937;
}

.settings-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #14b8a6, #3b82f6);
  display: flex;
  align-items: center;
  justify-content: center;
}

.user-avatar .icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
}

.content-area {
  flex: 1;
  display: flex;
  overflow: hidden;
}

.conversation-list {
  width: 384px;
  background: #1a1f2e;
  border-right: 1px solid #374151;
  display: flex;
  flex-direction: column;
}

.conversation-header {
  padding: 16px;
  border-bottom: 1px solid #374151;
}

.search-box {
  position: relative;
  margin-bottom: 12px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #6b7280;
  stroke-width: 2;
}

.search-box input {
  width: 100%;
  padding: 8px 16px 8px 40px;
  background: #0f1419;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
}

.search-box input::placeholder {
  color: #6b7280;
}

.search-box input:focus {
  outline: none;
  border-color: #14b8a6;
}

.filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  background: #0f1419;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
  cursor: pointer;
}

.filter-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.conversations {
  flex: 1;
  overflow-y: auto;
}

.conversation-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  background: transparent;
  border: none;
  border-bottom: 1px solid #374151;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
}

.conversation-item:hover,
.conversation-item.active {
  background: rgba(55, 65, 81, 0.5);
}

.conversation-avatar {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  position: relative;
}

.conversation-avatar.whatsapp {
  background: #10b981;
}

.conversation-avatar.telegram {
  background: #60a5fa;
}

.conversation-avatar.messenger {
  background: #3b82f6;
}

.conversation-avatar.teams {
  background: #a855f7;
}

.conversation-avatar .icon {
  width: 24px;
  height: 24px;
  color: white;
  stroke-width: 2;
}

.status-dot {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid #1a1f2e;
}

.status-dot.online {
  background: #10b981;
}

.status-dot.failed {
  background: #ef4444;
}

.conversation-info {
  flex: 1;
}

.conversation-info h3 {
  font-size: 16px;
  font-weight: 500;
  color: white;
  margin-bottom: 4px;
}

.conversation-info .date {
  font-size: 12px;
  color: #6b7280;
}

.conversation-info .meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.failed-badge {
  font-size: 12px;
  color: #f87171;
  font-weight: 500;
}

.message-thread {
  flex: 1;
  background: #0f1419;
  display: flex;
  flex-direction: column;
}

.thread-header {
  padding: 16px;
  border-bottom: 1px solid #374151;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.thread-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.thread-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
}

.thread-info h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.thread-info p {
  font-size: 12px;
  color: #9ca3af;
}

.menu-btn {
  padding: 8px;
  background: transparent;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.menu-btn:hover {
  background: #1f2937;
}

.menu-btn .icon {
  width: 20px;
  height: 20px;
  color: #9ca3af;
  stroke-width: 2;
}

.messages {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.message {
  max-width: 768px;
}

.message.ai {
  align-self: flex-end;
}

.message-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.message-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #60a5fa, #a855f7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}

.message-sender {
  font-size: 14px;
  font-weight: 500;
}

.message-time {
  font-size: 12px;
  color: #6b7280;
}

.message-content {
  padding: 16px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.6;
}

.message.user .message-content {
  background: #1f2937;
  color: #e5e7eb;
}

.message.ai .message-content {
  background: rgba(20, 184, 166, 0.2);
  border: 1px solid rgba(20, 184, 166, 0.3);
  color: #ccfbf1;
}

.message-input {
  padding: 16px;
  border-top: 1px solid #374151;
  display: flex;
  align-items: center;
  gap: 8px;
}

.stop-ai-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #ec4899;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.stop-ai-btn:hover {
  background: #db2777;
}

.stop-ai-btn .icon {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.message-input input {
  flex: 1;
  padding: 8px 16px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 8px;
  color: #d1d5db;
  font-size: 14px;
}

.message-input input::placeholder {
  color: #6b7280;
}

.message-input input:focus {
  outline: none;
  border-color: #14b8a6;
}

.send-btn {
  padding: 10px;
  background: #14b8a6;
  border: none;
  border-radius: 8px;
  color: white;
  cursor: pointer;
  transition: all 0.2s;
}

.send-btn:hover {
  background: #0d9488;
}

.send-btn .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.right-panel {
  width: 320px;
  background: #1a1f2e;
  border-left: 1px solid #374151;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.panel-card {
  background: #0f1419;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 16px;
}

.card-header {
  display: flex;
  align-items: center;
  justify-between;
  margin-bottom: 16px;
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title .icon {
  width: 20px;
  height: 20px;
  color: #14b8a6;
  stroke-width: 2;
}

.card-title h3 {
  font-size: 16px;
  font-weight: 600;
}

.n8n-dots {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.dot.red {
  background: #f87171;
}

.dot.teal {
  background: #14b8a6;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.status-indicator.online {
  background: #10b981;
}

.expand-btn {
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.expand-btn:hover {
  background: #1f2937;
}

.expand-btn .icon {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  stroke-width: 2;
}

.card-content {
  font-size: 14px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: #9ca3af;
}

.status-value {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #10b981;
}

.signin-title {
  text-align: center;
  padding: 8px 0;
  font-size: 14px;
  color: #9ca3af;
  margin-bottom: 16px;
}

.signin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group label {
  font-size: 12px;
  color: #9ca3af;
}

.form-group input {
  padding: 8px 12px;
  background: #1f2937;
  border: 1px solid #374151;
  border-radius: 4px;
  color: #d1d5db;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #14b8a6;
}

.password-input {
  position: relative;
}

.password-input input {
  width: 100%;
  padding-right: 40px;
}

.toggle-password {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  padding: 4px;
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s;
}

.toggle-password:hover {
  background: #374151;
}

.toggle-password .icon {
  width: 16px;
  height: 16px;
  color: #9ca3af;
  stroke-width: 2;
}

.signin-btn {
  width: 100%;
  padding: 8px;
  background: #ef4444;
  border: none;
  border-radius: 4px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.signin-btn:hover {
  background: #dc2626;
}

.forgot-btn {
  background: transparent;
  border: none;
  color: #f87171;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.forgot-btn:hover {
  color: #fca5a5;
}

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #1a1f2e;
}

::-webkit-scrollbar-thumb {
  background: #374151;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #4b5563;
}
