:root { 
  --bg: #ffffff; 
  --text: #1a1d29; 
  --muted: #6b7280; 
  --border: #e1e5e9; 
  --accent: #3b82f6; 
  --accent-hover: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --card-bg: #ffffff;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
*{ box-sizing:border-box }
html,body{ 
  height:100%; 
  background: #fafbfc;
  color:var(--text); 
  font-family:"Cal Sans","Inter",-apple-system,BlinkMacSystemFont,sans-serif;
  margin: 0;
  padding: 0;
  font-weight: 400;
}
a{ color:inherit; text-decoration:none }
.chat-shell{ 
  max-width:900px; 
  margin:0 auto; 
  height:100dvh; 
  display:grid; 
  grid-template-rows:auto 1fr auto auto; 
  gap:20px; 
  padding:24px;
  animation: slideUp 0.6s ease-out;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.chat-header{ 
  display:flex; 
  align-items:center; 
  justify-content:space-between; 
  border:1px solid var(--border); 
  border-radius:24px; 
  padding:20px 24px; 
  background: var(--card-bg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  position:sticky; 
  top:8px;
  backdrop-filter: blur(20px);
}

.agent-left{ display:flex; gap:16px; align-items:center }
.agent-avatar{ 
  width:48px; 
  height:48px; 
  border-radius:50%; 
  object-fit:cover; 
  border:3px solid var(--accent);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
  transition: transform 0.2s ease;
}
.agent-avatar:hover {
  transform: scale(1.05);
}
.agent-meta{ line-height:1.2 }
.agent-name{ 
  font-weight:600; 
  font-size: 17px;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.01em;
}
.agent-status{ 
  font-size:14px; 
  color:var(--muted); 
  display:flex; 
  align-items:center; 
  gap:8px;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.status-dot{ 
  width:10px; 
  height:10px; 
  border-radius:50%; 
  background: var(--success);
  box-shadow:0 0 0 3px rgba(16, 185, 129, .2);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.whatsapp-link{ 
  display:inline-flex; 
  align-items:center; 
  justify-content:center; 
  padding:12px; 
  border-radius:16px; 
  background: #25D366;
  color: white;
  transition:all .3s ease;
  box-shadow: 0 2px 12px rgba(37, 211, 102, 0.25);
  margin-right: 12px;
}
.whatsapp-link:hover{ 
  transform:translateY(-2px) scale(1.05); 
  box-shadow: 0 4px 20px rgba(37, 211, 102, 0.4);
  background: #128C7E;
}

.instagram-link{ 
  display:inline-flex; 
  align-items:center; 
  justify-content:center; 
  padding:12px; 
  border-radius:16px; 
  background: linear-gradient(135deg, #833ab4 0%, #fd1d1d 50%, #fcb045 100%);
  color: white;
  transition:all .3s ease;
  box-shadow: 0 2px 12px rgba(131, 58, 180, 0.25);
}
.instagram-link:hover{ 
  transform:translateY(-2px) scale(1.05); 
  box-shadow: 0 4px 20px rgba(131, 58, 180, 0.4);
}

.chat-body{ 
  border:1px solid var(--border); 
  border-radius:24px; 
  padding:24px; 
  overflow:auto; 
  background: var(--card-bg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  position: relative;
}
.msg{ 
  display:flex; 
  gap:12px; 
  margin:12px 0; 
  animation:messageSlide .4s ease;
  align-items: flex-end;
}
@keyframes messageSlide{ 
  from{ opacity:0; transform:translateY(10px) } 
  to{ opacity:1; transform:none } 
}
.msg .bubble{ 
  max-width:min(78ch, 85%); 
  padding:16px 20px; 
  border-radius:20px; 
  position: relative;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.08);
  word-wrap: break-word;
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: -0.005em;
}
.msg.user{ justify-content:flex-end }
.msg.user .bubble{ 
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  color:#fff; 
  border-bottom-right-radius: 8px;
}
.msg.bot .bubble{ 
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-bottom-left-radius: 8px;
}
.msg .time{ 
  font-size:11px; 
  color:var(--muted); 
  margin-top:4px;
  opacity: 0.7;
}
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 16px;
}

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

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

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

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

.chat-cta{ 
  display:flex; 
  align-items:center; 
  justify-content:center;
  gap:12px; 
  flex-wrap:wrap;
  padding: 8px 16px;
  background: var(--card-bg);
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.btn{ 
  border-radius:12px; 
  padding:10px 18px; 
  font-weight:600; 
  cursor:pointer; 
  transition:all .3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  text-decoration: none;
  letter-spacing: -0.01em;
  font-family: inherit;
}

.btn-outline{ 
  border:2px solid var(--border); 
  background: var(--card-bg);
  color: var(--text);
}

.btn-outline:hover{ 
  transform:translateY(-1px); 
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary{ 
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color:#fff; 
  border:2px solid transparent;
}

.btn-primary:hover{ 
  transform:translateY(-1px); 
  box-shadow:0 6px 20px rgba(59, 130, 246, 0.3);
}

.dashboard-link{ 
  margin-left:auto; 
  font-size:14px; 
  color: var(--accent);
  text-decoration:none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.dashboard-link:hover {
  background: rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
}

.chat-input{ 
  display:grid; 
  grid-template-columns:1fr auto; 
  gap:16px; 
  border:2px solid var(--border); 
  border-radius:24px; 
  padding:16px; 
  background: var(--card-bg);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
  transition: border-color 0.2s ease;
}

.chat-input:focus-within {
  border-color: var(--accent);
}

.chat-input textarea{ 
  border:none; 
  outline:none; 
  resize:none; 
  font:inherit; 
  padding:12px 16px; 
  max-height:120px;
  border-radius: 16px;
  background: transparent;
  font-weight: 500;
  letter-spacing: -0.005em;
}

/* Icon styles */
.icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.btn .icon {
  width: 18px;
  height: 18px;
}

/* Dashboard specific styles */
.filters {
  display: flex;
  gap: 16px;
  align-items: end;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 20px 24px;
  background: var(--card-bg);
  border-radius: 20px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.filters input[type="date"] {
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.2s ease;
}

.filters input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
}

@keyframes fadeIn{ from{ opacity:.001; transform:translateY(2px) } to{ opacity:1; transform:none } }

@media (max-width:640px){
  .chat-shell{ padding:20px; gap: 12px }
  .chat-header { padding: 16px 20px; }
  .social-links { gap: 6px; }
  .whatsapp-link, .instagram-link { padding: 10px; }
  .agent-name{ font-weight:600; font-size: 16px }
  .chat-cta { gap: 8px; padding: 6px 12px; }
  .btn { padding: 8px 16px; font-size: 13px; }
  .chat-input { padding: 12px; gap: 12px; }
}