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

body {
  font-family: -apple-system, Segoe UI, Tahoma, Arial, sans-serif;
  background: #f0f2f5;
  color: #1c1e21;
}

.container {
  max-width: 480px;
  margin: 60px auto;
  background: #fff;
  border-radius: 12px;
  padding: 32px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

h1 { font-size: 22px; margin-bottom: 6px; }
p.subtitle { color: #65676b; margin-bottom: 24px; font-size: 14px; }

label { display: block; font-size: 13px; margin-bottom: 6px; color: #444; }
input, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ccd0d5;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 16px;
  font-family: inherit;
}
textarea { resize: vertical; min-height: 60px; }

button {
  width: 100%;
  padding: 11px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
button:hover { background: #1fb356; }
button.secondary {
  background: #fff;
  color: #25d366;
  border: 1px solid #25d366;
  margin-top: 8px;
}

.msg { padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.msg.error { background: #fde2e2; color: #a1121f; }
.msg.success { background: #d9f7e6; color: #0a7a3b; }

.link-row { text-align: center; margin-top: 16px; font-size: 13px; }
.link-row a { color: #25d366; cursor: pointer; text-decoration: none; }

/* dashboard */
.dash { max-width: 900px; margin: 20px auto; display: flex; gap: 16px; height: 85vh; }
.panel { background: #fff; border-radius: 12px; box-shadow: 0 2px 12px rgba(0,0,0,0.08); overflow: hidden; display: flex; flex-direction: column; }
.conv-list { flex: 0 0 300px; }
.chat-panel { flex: 1; }
.panel-header { padding: 14px 16px; border-bottom: 1px solid #eee; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.panel-header button { width: auto; padding: 6px 12px; font-size: 12px; }
.conv-items { flex: 1; overflow-y: auto; }
.conv-item { padding: 12px 16px; border-bottom: 1px solid #f0f0f0; cursor: pointer; }
.conv-item:hover { background: #f7f7f7; }
.conv-item.active { background: #e7f9ee; }
.conv-item .phone { font-weight: 600; font-size: 14px; }
.conv-item .status { font-size: 12px; color: #888; }

.chat-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 70%; padding: 8px 12px; border-radius: 10px; font-size: 14px; }
.bubble.OUTBOUND { align-self: flex-start; background: #dcf8c6; }
.bubble.INBOUND { align-self: flex-end; background: #f0f0f0; }
.bubble .meta { font-size: 10px; color: #999; margin-top: 4px; }

.chat-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid #eee; }
.chat-input input { margin: 0; flex: 1; }
.chat-input button { width: auto; padding: 10px 20px; }

.empty-state { display: flex; align-items: center; justify-content: center; height: 100%; color: #999; font-size: 14px; }

.top-bar { max-width: 900px; margin: 16px auto 0; display: flex; justify-content: space-between; align-items: center; padding: 0 4px; }
.top-bar .brand { font-weight: 700; font-size: 18px; }
.top-bar button { width: auto; padding: 8px 16px; font-size: 13px; }

.conv-item.unread { background: #eefaf1; }
.conv-item.unread .phone { font-weight: 700; }
.conv-item.unread .status { color: #1fb356; font-weight: 600; }
