.inbox-page {
  display: grid;
  gap: 18px;
  max-width: 1380px;
  margin: auto;
}

.inbox-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  border-radius: 22px;
  background: linear-gradient(120deg, #18142f, #39225f 55%, #6f347e);
  color: #fff;
  box-shadow: 0 18px 46px rgba(47, 28, 82, .17);
}

.inbox-hero .eyebrow {
  color: #e879f9;
}

.inbox-hero h2 {
  margin: 6px 0;
  font-size: 29px;
}

.inbox-hero p {
  margin: 0;
  color: #ece4f5;
}

.inbox-hero .btn {
  flex: 0 0 auto;
  border: 0;
  background: #fff;
  color: #51258a;
}

.inbox-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 18px;
  border: 1px solid #e4e7ec;
  border-radius: 16px;
  background: #fff;
}

.inbox-toolbar>label {
  display: grid;
  gap: 7px;
  width: min(430px, 100%);
  font-size: 12px;
  font-weight: 800;
}

.inbox-toolbar select {
  height: 43px;
  padding: 0 13px;
  border: 1px solid #d0d5dd;
  border-radius: 10px;
  background: #fff;
}

.inbox-status-tabs {
  display: flex;
  gap: 5px;
  padding: 4px;
  border-radius: 11px;
  background: #f2f4f7;
}

.inbox-status-tabs a {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 35px;
  padding: 0 13px;
  border-radius: 8px;
  color: #667085;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
}

.inbox-status-tabs a.active {
  background: #fff;
  color: #6941c6;
  box-shadow: 0 1px 4px rgba(16, 24, 40, .1);
}

.inbox-status-tabs b {
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 10px;
  background: #7f56d9;
  color: #fff;
  font-size: 10px;
}

.inbox-layout {
  display: grid;
  grid-template-columns: minmax(300px, 390px) minmax(0, 1fr);
  min-height: 660px;
  overflow: hidden;
  border: 1px solid #e4e7ec;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 14px 38px rgba(16, 24, 40, .07);
}

.conversation-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-width: 0;
  border-right: 1px solid #eaecf0;
  background: #fcfcfd;
}

.conversation-panel>header,
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 75px;
  padding: 14px 18px;
  border-bottom: 1px solid #eaecf0;
  background: #fff;
}

.conversation-panel>header>div {
  display: grid;
  gap: 3px;
}

.conversation-panel>header strong {
  font-size: 15px;
}

.conversation-panel>header small {
  color: #98a2b3;
  font-size: 10px;
}

.conversation-panel>header>span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 10px;
  background: #f4ebff;
  color: #7f56d9;
}

.conversation-list {
  align-content: start;
  overflow-y: auto;
}

.conversation-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 11px;
  min-height: 90px;
  padding: 14px 16px;
  border-bottom: 1px solid #f2f4f7;
  color: #101828;
  text-decoration: none;
  transition: .16s ease;
}

.conversation-card:hover {
  background: #f9f5ff;
}

.conversation-card.active {
  background: #f4ebff;
  box-shadow: inset 3px 0 #7f56d9;
}

.inbox-avatar {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: linear-gradient(135deg, #f79009, #d92d20);
  color: #fff;
}

.inbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inbox-avatar.large {
  width: 52px;
  height: 52px;
}

.conversation-copy {
  display: grid;
  align-content: center;
  min-width: 0;
}

.conversation-copy>span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.conversation-copy strong,
.conversation-copy em,
.conversation-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-copy strong {
  font-size: 13px;
}

.conversation-copy time {
  flex: 0 0 auto;
  color: #98a2b3;
  font-size: 9px;
}

.conversation-copy small {
  margin-top: 2px;
  color: #98a2b3;
  font-size: 10px;
}

.conversation-copy em {
  margin-top: 5px;
  color: #667085;
  font-size: 11px;
  font-style: normal;
}

.conversation-card.unread .conversation-copy strong,
.conversation-card.unread .conversation-copy em {
  color: #101828;
  font-weight: 800;
}

.unread-count {
  position: absolute;
  right: 14px;
  bottom: 12px;
  display: grid;
  min-width: 20px;
  height: 20px;
  place-items: center;
  padding: 0 5px;
  border-radius: 999px;
  background: #7f56d9;
  color: #fff;
  font-size: 9px;
}

.inbox-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 54px;
  padding: 8px 13px;
  border-top: 1px solid #eaecf0;
  background: #fff;
}

.inbox-pagination span:last-child {
  text-align: right;
}

.inbox-pagination a {
  color: #6941c6;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.inbox-pagination>b {
  color: #98a2b3;
  font-size: 10px;
}

.conversation-empty,
.chat-placeholder,
.inbox-zero {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 7px;
  padding: 55px 24px;
  text-align: center;
}

.conversation-empty span,
.chat-placeholder span,
.inbox-zero>span {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  background: #f4ebff;
  color: #7f56d9;
  font-size: 22px;
}

.conversation-empty small,
.chat-placeholder p,
.inbox-zero p {
  margin: 0;
  color: #667085;
}

.inbox-zero {
  min-height: 400px;
  border: 1px dashed #d0d5dd;
  border-radius: 20px;
  background: #fff;
}

.inbox-zero h3,
.chat-placeholder h3 {
  margin: 3px 0 0;
}

.chat-panel {
  display: grid;
  grid-template-rows: auto auto minmax(360px, 1fr) auto;
  min-width: 0;
  background: #fff;
}

.chat-panel>.chat-placeholder {
  grid-row: 1 / -1;
}

.chat-header>div:first-child {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mobile-chat-back {
  display: none;
  color: #6941c6;
  text-decoration: none;
  font-size: 20px;
  font-weight: 900;
}

.chat-header p {
  display: grid;
  gap: 3px;
  margin: 0;
}

.chat-header strong {
  font-size: 15px;
}

.chat-header small {
  color: #667085;
  font-size: 11px;
}

.contact-flags {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.contact-flags span,
.contact-flags a {
  padding: 6px 9px;
  border-radius: 999px;
  background: #ecfdf3;
  color: #027a48;
  text-decoration: none;
  font-size: 9px;
  font-weight: 800;
}

.contact-flags a {
  background: #f4ebff;
  color: #6941c6;
}

.chat-tools {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  min-height: 45px;
  padding: 7px 18px;
  border-bottom: 1px solid #eaecf0;
  background: #fcfcfd;
}

.chat-tools button {
  min-height: 31px;
  padding: 0 10px;
  border: 1px solid #d0d5dd;
  border-radius: 8px;
  background: #fff;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.message-stage {
  display: grid;
  align-content: end;
  min-height: 0;
  padding: 20px 22px;
  overflow-y: auto;
  background:
    radial-gradient(circle at 15% 20%, rgba(244,235,255,.75), transparent 26%),
    linear-gradient(#f9fafb, #fff);
}

.message-list {
  display: grid;
  align-content: end;
  gap: 10px;
}

.message-bubble {
  width: fit-content;
  max-width: min(72%, 640px);
  padding: 10px 13px 7px;
  border: 1px solid #e4e7ec;
  border-radius: 16px 16px 16px 4px;
  background: #fff;
  box-shadow: 0 3px 10px rgba(16, 24, 40, .04);
}

.message-bubble.outgoing {
  justify-self: end;
  border-color: #e9d7fe;
  border-radius: 16px 16px 4px 16px;
  background: #f4ebff;
}

.message-bubble p {
  margin: 0;
  font-size: 13px;
  line-height: 1.65;
}

.message-bubble footer {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  margin-top: 5px;
  color: #98a2b3;
  font-size: 8px;
}

.message-bubble footer span {
  color: #6941c6;
}

.message-media img,
.message-bubble video {
  display: block;
  width: min(320px, 100%);
  max-height: 340px;
  margin-top: 7px;
  border-radius: 10px;
  object-fit: cover;
}

.message-file {
  display: block;
  margin-top: 7px;
  padding: 9px;
  border-radius: 9px;
  background: rgba(255,255,255,.72);
  color: #6941c6;
  text-decoration: none;
  font-size: 11px;
  font-weight: 800;
}

.message-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 16px;
}

.message-pagination a {
  padding: 7px 11px;
  border: 1px solid #e9d7fe;
  border-radius: 999px;
  background: #fff;
  color: #6941c6;
  text-decoration: none;
  font-size: 10px;
  font-weight: 800;
}

.message-empty {
  align-self: center;
  padding: 60px 20px;
  color: #667085;
  text-align: center;
  font-size: 12px;
}

.message-composer {
  display: grid;
  gap: 9px;
  padding: 14px 18px;
  border-top: 1px solid #eaecf0;
  background: #fff;
}

.message-composer textarea {
  width: 100%;
  resize: vertical;
  padding: 12px 13px;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  background: #fcfcfd;
  font: inherit;
  font-size: 13px;
}

.message-composer textarea:focus {
  border-color: #9e77ed;
  outline: 3px solid #f4ebff;
}

.message-composer>footer {
  display: flex;
  align-items: center;
  gap: 9px;
}

.message-composer>footer small {
  margin-right: auto;
  color: #98a2b3;
  font-size: 9px;
}

.attachment-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 35px;
  padding: 0 11px;
  border: 1px solid #d0d5dd;
  border-radius: 9px;
  color: #475467;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.attachment-picker input {
  display: none;
}

.message-composer .btn {
  min-height: 37px;
  padding: 0 14px;
}

@media (max-width: 960px) {
  .inbox-layout {
    grid-template-columns: 320px minmax(0, 1fr);
  }

  .contact-flags span {
    display: none;
  }

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

@media (max-width: 760px) {
  .inbox-hero {
    align-items: flex-start;
    flex-direction: column;
    padding: 22px;
  }

  .inbox-hero h2 {
    font-size: 23px;
  }

  .inbox-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .inbox-layout,
  .inbox-layout.has-thread {
    display: block;
    min-height: 0;
  }

  .conversation-panel {
    min-height: 560px;
    border-right: 0;
  }

  .inbox-layout.has-thread .conversation-panel {
    display: none;
  }

  .inbox-layout:not(.has-thread) .chat-panel {
    display: none;
  }

  .chat-panel {
    min-height: 680px;
  }

  .chat-header {
    align-items: flex-start;
    gap: 10px;
  }

  .mobile-chat-back {
    display: inline-flex;
  }

  .message-stage {
    min-height: 420px;
    padding: 16px 12px;
  }

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

  .message-composer>footer {
    flex-wrap: wrap;
  }

  .message-composer>footer small {
    display: none;
  }

  .message-composer .btn {
    margin-left: auto;
  }
}
