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

body {
  font-family: 'DM Sans', sans-serif;
  background: #0d0d1a;
  color: #e0e0e0;
  height: 100vh;
  overflow: hidden;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100vh;
}

/* ===== Header ===== */
.header {
  background: #1a1a2e;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #2a2a3e;
  flex-shrink: 0;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.hotel-logo {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  color: #fff;
}

.hotel-name {
  font-weight: 700;
  font-size: 16px;
  color: #fff;
}

.header-subtitle {
  font-size: 12px;
  color: #888;
}

.header-codes {
  display: flex;
  align-items: center;
  gap: 20px;
}

.code-today, .code-tomorrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.code-label {
  font-size: 10px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.code-today .code-value {
  font-family: 'Space Mono', monospace;
  font-size: 28px;
  font-weight: 700;
  color: #2dd4bf;
  letter-spacing: 4px;
}

.code-tomorrow .code-value {
  font-family: 'Space Mono', monospace;
  font-size: 16px;
  color: #6b7280;
  letter-spacing: 2px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
}

.status-dot.connected {
  background: #2dd4bf;
}

/* ===== Main Content ===== */
.main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 320px;
  background: #141425;
  border-right: 1px solid #2a2a3e;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid #2a2a3e;
}

.sidebar-header h3 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: #fff;
}

.filter-tabs {
  display: flex;
  gap: 4px;
}

.filter-btn {
  padding: 4px 10px;
  border: 1px solid #2a2a3e;
  border-radius: 4px;
  background: transparent;
  color: #888;
  font-size: 11px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.filter-btn.active {
  background: #6366f1;
  border-color: #6366f1;
  color: #fff;
}

.filter-btn:hover:not(.active) {
  border-color: #6366f1;
  color: #c0c0c0;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
}

.empty-state {
  padding: 40px 20px;
  text-align: center;
  color: #555;
  font-size: 13px;
}

.conv-item {
  padding: 12px 16px;
  border-bottom: 1px solid #1e1e35;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.conv-item:hover {
  background: #1e1e35;
}

.conv-item.active {
  background: #252545;
  border-left: 3px solid #6366f1;
}

.conv-item.escalated {
  border-left: 3px solid #ef4444;
}

.conv-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: #2a2a3e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}

.conv-info {
  flex: 1;
  min-width: 0;
}

.conv-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}

.conv-room {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
}

.conv-time {
  font-size: 10px;
  color: #666;
}

.conv-preview {
  font-size: 12px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.conv-badges {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.badge-lang {
  background: #1e1e35;
  color: #e0e0e0;
}

.badge-intent {
  color: #fff;
}

.badge-unread {
  background: #6366f1;
  color: #fff;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}

.badge-channel {
  background: #1e1e35;
  color: #aaa;
  font-size: 9px;
}

/* ===== Chat Panel ===== */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #555;
}

.placeholder-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.chat-placeholder h3 {
  font-size: 16px;
  color: #888;
  margin-bottom: 4px;
}

.chat-placeholder p {
  font-size: 13px;
  color: #555;
}

.chat-active {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

/* Chat Header */
.chat-header {
  padding: 10px 16px;
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a3e;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

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

.room-badge {
  font-family: 'Space Mono', monospace;
  font-weight: 700;
  font-size: 16px;
  color: #2dd4bf;
}

.lang-badge {
  font-size: 13px;
}

.channel-badge {
  font-size: 11px;
  color: #888;
  background: #2a2a3e;
  padding: 2px 8px;
  border-radius: 4px;
}

.takeover-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
}

.takeover-status.human {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: scroll;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0; /* critical for flex overflow scroll */
}

.msg-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.msg-group.guest {
  align-items: flex-end;
}

.msg-group.bot,
.msg-group.staff,
.msg-group.system {
  align-items: flex-start;
}

.msg-speaker {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0 4px;
}

.msg-speaker.guest { color: #2dd4bf; }
.msg-speaker.bot { color: #6b7280; }
.msg-speaker.staff { color: #818cf8; }
.msg-speaker.system { color: #eab308; }

.msg-bubble {
  max-width: 85%;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 13px;
  line-height: 1.5;
  position: relative;
}

.msg-group.guest .msg-bubble {
  background: #0d3d36;
  border: 1px solid #145a4e;
  color: #d0f5ee;
}

.msg-group.bot .msg-bubble {
  background: #262626;
  border: 1px solid #3a3a3a;
  color: #e0e0e0;
}

.msg-group.staff .msg-bubble {
  background: #1e1a4a;
  border: 1px solid #3730a3;
  color: #c7c3f7;
}

.msg-group.system .msg-bubble {
  background: #2a2515;
  border: 1px solid #4a3f1e;
  color: #d4c85a;
  font-size: 12px;
  text-align: center;
}

.msg-original {
  margin-bottom: 4px;
}

.msg-reformulated {
  font-style: italic;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
  margin-bottom: 4px;
}

.msg-translation {
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 4px;
}

.msg-translation-label {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.35);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.msg-audio-btn {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 12px;
  color: #e0e0e0;
  padding: 3px 10px;
  font-size: 11px;
  cursor: pointer;
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.msg-audio-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.msg-intent-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  margin-top: 4px;
}

.msg-time {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.3);
  margin-top: 4px;
}

/* Reply Area */
.reply-area {
  background: #1a1a2e;
  padding: 12px 16px;
  border-top: 1px solid #2a2a3e;
  flex-shrink: 0;
}

.reply-controls {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.reply-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

#staff-input {
  flex: 1;
  padding: 10px 14px;
  background: #262640;
  border: 1px solid #3a3a5e;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  font-family: 'DM Sans', sans-serif;
  outline: none;
}

#staff-input:focus {
  border-color: #6366f1;
}

.recording-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  color: #ef4444;
  font-size: 12px;
}

.pulse {
  width: 10px;
  height: 10px;
  background: #ef4444;
  border-radius: 50%;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* ===== Info Panel ===== */
.info-panel {
  width: 280px;
  background: #141425;
  border-left: 1px solid #2a2a3e;
  padding: 16px;
  overflow-y: auto;
  flex-shrink: 0;
}

.info-placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 13px;
}

.info-title {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 16px;
}

.info-section {
  margin-bottom: 20px;
}

.info-section h4 {
  font-size: 11px;
  font-weight: 600;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #1e1e35;
}

.info-label {
  font-size: 12px;
  color: #888;
}

.info-value {
  font-size: 13px;
  font-weight: 600;
  color: #e0e0e0;
}

.intent-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.intent-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background: #1e1e35;
  border-radius: 4px;
  font-size: 11px;
}

.intent-item .intent-icon {
  font-size: 14px;
}

.intent-item .intent-count {
  margin-left: auto;
  font-family: 'Space Mono', monospace;
  font-size: 10px;
  color: #888;
}

.no-data {
  font-size: 12px;
  color: #555;
}

/* ===== Buttons ===== */
.btn {
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
}

.btn-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #6366f1;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
}

.btn-send:hover { background: #5558e6; }

.btn-mic {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #262640;
  color: #ef4444;
  border: 1px solid #3a3a5e;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  padding: 0;
  flex-shrink: 0;
}

.btn-mic.recording {
  background: #ef4444;
  color: #fff;
  animation: pulse 1s infinite;
}

.btn-takeover {
  background: #ef4444;
  color: #fff;
}

.btn-takeover:hover { background: #dc2626; }

.btn-release {
  background: #10b981;
  color: #fff;
}

.btn-release:hover { background: #059669; }

.btn-outline {
  background: transparent;
  border: 1px solid #3a3a5e;
  color: #888;
}

.btn-outline:hover {
  border-color: #6366f1;
  color: #c0c0c0;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 11px;
}

.btn-danger {
  background: #ef4444;
  color: #fff;
}

.btn-danger:hover { background: #dc2626; }

.btn-full {
  width: 100%;
}

.btn-dept-link {
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: #fff;
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-dept-link:hover {
  opacity: 0.85;
}

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

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* ===== Language Tags ===== */
.msg-lang-tag {
  display: inline-block;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  margin-right: 6px;
  font-weight: 500;
}

.msg-translation-en {
  border-top-color: rgba(0, 100, 200, 0.2);
}

/* ===== Guest Facts ===== */
.guest-facts {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.fact-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 6px;
  gap: 8px;
}

.fact-label {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  font-weight: 500;
  white-space: nowrap;
  min-width: 80px;
}

.fact-value {
  font-size: 12px;
  color: #e0e0e0;
  text-align: right;
  word-break: break-word;
}

/* ===== Action Badge (in messages) ===== */
.msg-action-badge {
  margin-top: 6px;
  padding: 4px 8px;
  background: rgba(245, 158, 11, 0.12);
  border-left: 3px solid #f59e0b;
  border-radius: 4px;
  font-size: 11px;
  color: #fbbf24;
}

/* ===== Communication History / Actions Log ===== */
.actions-log {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-item {
  padding: 8px;
  background: rgba(99, 102, 241, 0.08);
  border-left: 3px solid #6366f1;
  border-radius: 4px;
}

.action-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  color: #a5b4fc;
  text-transform: capitalize;
  margin-bottom: 3px;
}

.action-time {
  font-size: 10px;
  color: #666;
  font-weight: 400;
}

.action-summary {
  font-size: 12px;
  color: #e0e0e0;
  line-height: 1.4;
}
