* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background-color: #0e1621;
  color: #ffffff;
}

.app {
  display: flex;
  height: 100vh;
}

/* Sidebar */

.sidebar {
  width: 320px;
  background-color: #17212b;
  border-right: 1px solid #202b36;
  display: flex;
  flex-direction: column;
}

.sidebar-header {
  padding: 10px 12px 8px 12px;
  border-bottom: 1px solid #202b36;
}

.sidebar-header h1 {
  font-size: 16px;
  margin: 0 0 4px 0;
  font-weight: 600;
}

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

/* Chat list items */

.chat-item {
  padding: 8px 10px;
  cursor: pointer;
  border-bottom: 1px solid #202b36;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-item:hover {
  background-color: #202b36;
}

.chat-item.active {
  background-color: #2b5278;
}

.chat-item-title {
  font-weight: 600;
  font-size: 14px;
}

.chat-item-sub {
  font-size: 12px;
  opacity: 0.8;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Main area */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 56px;
  border-bottom: 1px solid #202b36;
  display: flex;
  align-items: center;
  padding: 0 16px;
  background-color: #17212b;
}

.chat-title {
  font-weight: 600;
  font-size: 15px;
}

.chat-title a {
  color: #ffffff;
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.4);
}

.chat-title a:hover {
  border-bottom-style: solid;
}

/* Body: messages + details */

.chat-body {
  flex: 1;
  display: flex;
  min-height: 0;
}

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background-color: #0e1621;
}

.chat-details {
  width: 260px;
  border-left: 1px solid #202b36;
  background-color: #17212b;
  padding: 12px 14px;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-details-empty {
  opacity: 0.6;
}

/* Appointment details */

.details-title {
  font-weight: 600;
  margin-bottom: 4px;
}

.details-row {
  margin-bottom: 4px;
}

.details-label {
  opacity: 0.7;
}

.details-value {
  font-weight: 500;
}

/* Date divider */

.date-divider {
  text-align: center;
  margin: 8px 0;
  position: relative;
  font-size: 11px;
  opacity: 0.8;
}

.date-divider span {
  background-color: #0e1621;
  padding: 2px 8px;
  border-radius: 16px;
  border: 1px solid #202b36;
}

/* Messages */

.message-row {
  margin-bottom: 10px;
  display: flex;
}

.message-row.user {
  justify-content: flex-start;
}

.message-row.assistant {
  justify-content: flex-end;
}

.message-row.admin {
  justify-content: center;
}

.message-bubble {
  max-width: 70%;
  padding: 8px 10px;
  border-radius: 16px;
  font-size: 14px;
  white-space: pre-wrap;
  word-wrap: break-word;
  line-height: 1.4;
}

.message-row.user .message-bubble {
  background-color: #182533;
  border-bottom-left-radius: 4px;
}

.message-row.assistant .message-bubble {
  background-color: #2b5278;
  border-bottom-right-radius: 4px;
}

.message-row.admin .message-bubble {
  background-color: #3b8c4d;
}

.message-meta {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}

.message-meta a {
  color: #7daefb;
  text-decoration: none;
}

.message-meta a:hover {
  text-decoration: underline;
}

/* Search */

.search-input {
  margin-top: 4px;
  width: 100%;
  padding: 6px 8px;
  border-radius: 16px;
  border: 1px solid #202b36;
  background-color: #0e1621;
  color: #ffffff;
  font-size: 13px;
}

.search-input::placeholder {
  color: #7f8b99;
}

.search-input:focus {
  outline: none;
  border-color: #2b5278;
}
