* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #0b1120;
  color: white;
}

header {
  height: 62px;
  background: #ff6a00;
  padding: 12px 18px;
  font-size: 22px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header-title {
  display: flex;
  align-items: center;
}

.new-conversation-button {
  background: white;
  color: #ff6a00;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: bold;
}

.layout {
  display: flex;
  height: calc(100vh - 62px);
}

.sidebar {
  width: 420px;
  background: #111827;
  border-right: 1px solid #263244;
  overflow: auto;
}

.search-box {
  padding: 12px;
  border-bottom: 1px solid #263244;
}

.search-box input {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #0b1120;
  color: white;
}

.label-filter {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 10px 12px;
  border-bottom: 1px solid #263244;
}

.label-filter a {
  color: white;
  text-decoration: none;
  font-size: 12px;
  border: 1px solid #374151;
  padding: 5px 8px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.label-filter a span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.active-filter {
  background: #263244;
}

.contact {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid #263244;
  text-decoration: none;
  color: white;
}

.contact:hover,
.contact.active {
  background: #1f2937;
}

.avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
}

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

.name {
  font-weight: bold;
}

.phone {
  color: #9ca3af;
  font-size: 13px;
}

.last {
  color: #d1d5db;
  font-size: 13px;
  margin-top: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.contact-label {
  display: inline-block;
  color: white;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 11px;
  margin-top: 5px;
  margin-bottom: 2px;
}

.main {
  flex: 1;
}

.empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 20px;
}

.chat {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.chat-header {
  height: 82px;
  background: #111827;
  border-bottom: 1px solid #263244;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
}

.chat-info {
  flex: 1;
}

.label-select-form select {
  background: #0b1120;
  color: white;
  border: 1px solid #374151;
  border-radius: 8px;
  padding: 9px;
}

.messages {
  flex: 1;
  overflow: auto;
  padding: 20px;
}

.msg {
  max-width: 650px;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
}

.in {
  background: #1f2937;
}

.out {
  background: #14532d;
  margin-left: auto;
}

.meta {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 5px;
}

.send-form {
  display: flex;
  gap: 10px;
  padding: 14px;
  background: #111827;
}

.send-form textarea {
  flex: 1;
  resize: none;
  min-height: 46px;
  border-radius: 10px;
  border: 1px solid #374151;
  background: #0b1120;
  color: white;
  padding: 12px;
}

.send-form button {
  background: #ff6a00;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 0 20px;
  cursor: pointer;
}

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.modal-backdrop.active {
  display: flex;
}

.modal-box {
  width: 430px;
  background: #111827;
  border: 1px solid #263244;
  border-radius: 14px;
  padding: 18px;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.modal-header h2 {
  margin: 0;
}

.modal-header button {
  background: transparent;
  color: white;
  border: 0;
  font-size: 26px;
  cursor: pointer;
}

.modal-box label {
  display: block;
  margin-top: 10px;
  margin-bottom: 5px;
  color: #d1d5db;
  font-size: 13px;
}

.modal-box input,
.modal-box textarea {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #374151;
  background: #0b1120;
  color: white;
  padding: 10px;
}

.modal-box textarea {
  min-height: 90px;
  resize: vertical;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 14px;
}

.modal-actions button {
  border: 0;
  border-radius: 8px;
  padding: 10px 13px;
  cursor: pointer;
}

.modal-actions button[type="submit"] {
  background: #ff6a00;
  color: white;
}

.modal-actions button[type="button"] {
  background: #374151;
  color: white;
}
