.complaint-tabs-root {
  width: 100%;
}

.complaint-tabs {
  display: flex;
  gap: 4px;
  margin: 0 auto 16px;
  max-width: 1000px;
  border-bottom: 2px solid #37a4d2;
}

.complaint-tabs button {
  min-width: 150px;
  padding: 10px 18px;
  border: 0;
  border-radius: 3px 3px 0 0;
  background: #e1e1e1;
  color: #0f0b06;
  font-weight: 700;
  text-transform: uppercase;
}

.complaint-tabs button.active {
  background: #37a4d2;
  color: #fff;
}

.complaint-panel {
  max-width: 1000px;
  margin: 0 auto;
}

.messages-panel {
  padding: 15px;
  border: 1px solid #e1e1e1;
  background: #fff;
}

.messages-history {
  max-height: 48vh;
  min-height: 160px;
  overflow-y: auto;
  padding: 10px;
  background: #f7f8f9;
}

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

.message-client {
  justify-content: flex-end;
}

.message-operator {
  justify-content: flex-start;
}

.message-bubble {
  max-width: 75%;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e6f4fa;
  overflow-wrap: anywhere;
}

.message-client .message-bubble {
  background: #dff4ec;
}

.message-bubble p {
  margin: 5px 0;
  white-space: normal;
}

.message-bubble time,
.message-status time {
  display: block;
  color: #666;
  font-size: 11px;
  text-align: right;
}

.message-status {
  margin: 12px 0;
  color: #555;
  font-size: 12px;
  text-align: center;
}

.message-status span {
  display: inline-block;
  padding: 5px 10px;
  border-radius: 12px;
  background: #e1e1e1;
}

.message-status time {
  margin-top: 3px;
  text-align: center;
}

.messages-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 15px;
}

.messages-form label {
  grid-column: 1 / -1;
  font-weight: 700;
}

.messages-form textarea {
  min-height: 90px;
  padding: 8px;
  resize: vertical;
}

.messages-form button {
  align-self: end;
}

.messages-error {
  min-height: 18px;
  margin: 8px 0 0;
  color: #f52746;
}

.messages-empty {
  color: #666;
  text-align: center;
}

@media (max-width: 767px) {
  .complaint-tabs button {
    min-width: 0;
    flex: 1;
  }

  .message-bubble {
    max-width: 90%;
  }

  .messages-form {
    grid-template-columns: 1fr;
  }
}
