/* =========================
  ScanWin — messages.css
========================= */
.sw-app__main:has(> .sw-message__content) {
  height: 100svh;
}
.sw-message__content {
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.sw-msg-app {
  display: grid;
  grid-template-columns: minmax(0, min(380px, 40%)) minmax(0, 1fr);
  flex: 1 1 auto;
  min-height: 0;
  --bs-border-color: var(--sw-border);
}

.sw-inbox {
  display: flex;
  border: 1px solid var(--sw-border);
  border-radius: 16px 0 0 16px;
  height: 100%;
}
.sw-inbox__head {
  padding: 22px 20px 14px;
}
.sw-inbox__title h2 {
  font-size: 18px;
  letter-spacing: -0.4px;
}

.sw-inbox__count {
  --bs-badge-font-size: 11px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: var(--sw-violet);
  --bs-badge-padding-y: 0;
  --bs-badge-padding-x: 6px;
  background: var(--sw-violet-50);
  min-width: 20px;
  height: 20px;
}

.sw-inbox__compose,
.sw-chat__back,
.sw-chat__action-btn {
  width: 36px;
  height: 36px;
  --bs-btn-border-radius: 8px;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}
.sw-inbox__search {
  padding: 0 20px 18px;
}
.sw-inbox__search-input {
  height: 40px;
  padding: 0 12px;
  background: #f3f4f6;
  border: 1px solid var(--sw-border);
  border-radius: 10px;
}
.sw-inbox__search-input input {
  outline: 0;
  font-size: 12px;
  color: #0f1020;
}
.sw-inbox__search-input input::placeholder {
  color: var(--sw-text-faint);
}
.sw-inbox__search-input svg {
  width: 16px;
  height: 16px;
  color: var(--sw-text-faint);
}

.sw-inbox__filters {
  padding: 8px 20px;
}
.sw-inbox-tab {
  gap: 6px;
  --bs-nav-link-padding-y: 6px;
  --bs-nav-link-padding-x: 12px;
  --bs-nav-link-font-size: 12px;
  --bs-nav-link-font-weight: 500;
  --bs-nav-link-color: #6b7280;
  --bs-nav-link-hover-color: #0f1020;
  --bs-nav-pills-border-radius: 999px;
  --bs-nav-pills-link-active-bg: var(--sw-violet-50);
  --bs-nav-pills-link-active-color: var(--sw-violet);
}
.sw-inbox-tab:hover {
  background: #f9fafb;
}
.sw-inbox-tab.active {
  font-weight: 600;
}
.sw-inbox-tab.active:hover {
  background: var(--sw-violet-50);
}
.sw-inbox-tab__count {
  --bs-badge-font-size: 11px;
  --bs-badge-color: inherit;
  --bs-badge-padding-y: 0;
  --bs-badge-padding-x: 6px;
  min-width: 18px;
  height: 16px;
}
.sw-inbox-tab.active .sw-inbox-tab__count {
  background: var(--sw-violet);
  color: #fff;
}
.sw-inbox-tab__count--gray {
  background: #f3f4f6;
  color: #6b7280;
}

.sw-conv-list {
  --bs-border-color: #f3f4f6;
  --bs-list-group-border-color: #f3f4f6;
  --bs-list-group-item-padding-x: 20px;
  --bs-list-group-item-padding-y: 16px;
  --bs-list-group-action-hover-bg: #fafafb;
  --bs-list-group-action-active-bg: #fafafb;
  --bs-list-group-active-bg: #f0ebff;
  --bs-list-group-active-color: inherit;
  --bs-list-group-active-border-color: #f3f4f6;
}
.sw-conv {
  gap: 12px;
  transition: background 0.12s;
}
.sw-conv__photo {
  width: 44px;
  height: 44px;
  background: #f3f4f6;
}
.sw-conv__photo--letter {
  background: #f0ebff;
  color: var(--sw-violet);
  font-size: 14px;
  font-weight: 600;
}
.sw-conv__name-row {
  gap: 6px;
}
.sw-conv__name {
  font-size: 13px;
}
.sw-conv__role-badge {
  line-height: 1.5;
  --bs-badge-font-size: 9px;
  --bs-badge-font-weight: 600;
  --bs-badge-color: var(--sw-violet);
  --bs-badge-padding-y: 1px;
  --bs-badge-padding-x: 6px;
  --bs-badge-border-radius: 4px;
  background: #ddd9fc;
  letter-spacing: 0.54px;
}
.sw-conv__time {
  font-size: 11px;
  color: var(--sw-text-faint);
}
.sw-conv__preview {
  font-size: 12px;
  color: #6b7280;
  line-height: 16px;
}
.sw-conv__unread-dot {
  width: 8px;
  height: 8px;
  background: var(--sw-violet);
}

.sw-chat {
  display: flex;
  border: 1px solid var(--sw-border);
  border-radius: 0 16px 16px 0;
}
.sw-chat__head {
  display: flex;
  gap: 12px;
  padding: 16px 24px;
}

.sw-chat__back {
  --bs-btn-bg: #f3f4f6;
  --bs-btn-color: #0f1020;
  --bs-btn-hover-bg: #e9eaee;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-active-bg: #e9eaee;
  --bs-btn-active-color: #0f1020;
  --bs-btn-border-width: 0;
}
.sw-chat__back svg {
  width: 18px;
  height: 18px;
}
.sw-chat__photo {
  width: 40px;
  height: 40px;
  background: #f3f4f6;
}
.sw-chat__person {
  gap: 2px;
  line-height: 1.3;
}
.sw-chat__name {
  font-size: 14px;
}
.sw-chat__online-dot {
  width: 8px;
  height: 8px;
  background: #10b981;
}
.sw-chat__role {
  font-size: 11px;
  color: #6b7280;
}
.sw-chat__role strong {
  color: #10b981;
}
.sw-chat__actions {
  gap: 6px;
}

.sw-chat__action-btn {
  --bs-btn-color: #6b7280;
}
.sw-chat__action-btn svg {
  width: 16px;
  height: 16px;
}

.sw-chat__body {
  display: flex;
  padding: 24px 32px;
  background: var(--sw-violet-50);
}

.sw-chat__day {
  font-size: 10px;
  color: var(--sw-text-faint);
}
.sw-chat__day-line {
  height: 1px;
  background: var(--sw-border);
  border: 0;
}

.sw-msg-row {
  gap: 10px;
  max-width: 80%;
}
.sw-msg-row__photo {
  width: 32px;
  height: 32px;
}
.sw-msg-bubble {
  padding: 10px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 20px;
  background: #fff;
  border: 1px solid var(--sw-border);
  color: #0f1020;
  word-wrap: break-word;
}
.sw-msg-row__time {
  font-size: 10px;
  color: var(--sw-text-faint);
}
.sw-msg-row--out .sw-msg-bubble {
  background: var(--sw-violet);
  color: #fff;
  border-color: var(--sw-violet);
}
.sw-msg-row--out .sw-msg-row__bubble-wrap {
  align-items: flex-end;
}

.sw-msg-quote {
  gap: 2px;
  margin-bottom: 6px;
  padding: 6px 10px;
  background: #f3f4f6;
  --bs-border-color: var(--sw-violet);
  border-radius: 6px;
}
.sw-msg-quote__author {
  font-size: 11px;
  color: var(--sw-violet);
  line-height: 16px;
}
.sw-msg-quote__text {
  font-size: 12px;
  color: #6b7280;
  line-height: 16px;
}

.sw-chat__reply-preview {
  display: flex;
  gap: 12px;
  padding: 12px 24px 12px 28px;
  background: var(--sw-violet-50);
}
.sw-chat__reply-info {
  gap: 10px;
}
.sw-chat__reply-icon {
  width: 16px;
  height: 16px;
  color: var(--sw-violet);
}
.sw-chat__reply-meta {
  gap: 2px;
}
.sw-chat__reply-label {
  font-size: 12px;
  color: var(--sw-violet);
  line-height: 16px;
}
.sw-chat__reply-text {
  font-size: 11px;
  color: #6b7280;
  line-height: 14px;
}

.sw-chat__reply-close {
  --bs-btn-bg: #fff;
  --bs-btn-color: #6b7280;
  --bs-btn-hover-bg: #fff;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-active-bg: #fff;
  --bs-btn-active-color: #0f1020;
  --bs-btn-border-width: 0;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
  width: 28px;
  height: 28px;
}
.sw-chat__reply-close svg {
  width: 14px;
  height: 14px;
}

.sw-chat__composer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  --bs-border-color: #f3f4f6;
}

.sw-chat__attach,
.sw-chat__send {
  width: 48px;
  height: 48px;
  --bs-btn-border-radius: 12px;
  --bs-btn-border-width: 0;
  --bs-btn-focus-shadow-rgb: 110, 93, 248;
}
.sw-chat__attach {
  --bs-btn-bg: #f3f4f6;
  --bs-btn-color: #6b7280;
  --bs-btn-hover-bg: #e9eaee;
  --bs-btn-hover-color: #0f1020;
  --bs-btn-active-bg: #e9eaee;
  --bs-btn-active-color: #0f1020;
}
.sw-chat__attach svg {
  width: 18px;
  height: 18px;
}
.sw-chat__input-wrap {
  height: 48px;
  padding: 0 16px;
  background: #f3f4f6;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}
.sw-chat__input-wrap input {
  outline: 0;
  font-size: 14px;
  color: #0f1020;
}
.sw-chat__input-wrap input::placeholder {
  color: var(--sw-text-faint);
}
.sw-chat__send {
  --bs-btn-bg: transparent;
  --bs-btn-color: var(--sw-violet);
  --bs-btn-hover-bg: var(--sw-violet-50);
  --bs-btn-hover-color: var(--sw-violet);
  --bs-btn-active-bg: var(--sw-violet-50);
  --bs-btn-active-color: var(--sw-violet);
  right: 4px;
}
.sw-chat__send svg {
  width: 22px;
  height: 22px;
}

.sw-inbox__empty,
.sw-chat__empty {
  display: none;
}
.sw-msg-app--empty .sw-conv-list {
  display: none;
}
.sw-msg-app--empty .sw-inbox__empty {
  display: flex;
}
.sw-msg-app--empty .sw-chat__head,
.sw-msg-app--empty .sw-chat__body,
.sw-msg-app--empty .sw-chat__reply-preview,
.sw-msg-app--empty .sw-chat__composer {
  display: none;
}
.sw-msg-app--empty .sw-chat__empty {
  display: flex;
}

.sw-msg-app--empty .sw-chat {
  border-left: 0;
}

.sw-inbox__empty {
  padding: 0 32px;
}
.sw-chat__empty {
  gap: 20px;
  padding: 0 80px;
}
.sw-empty__icon {
  background: #f0ebff;
  color: var(--sw-violet);
}
.sw-empty__icon--sm {
  width: 48px;
  height: 48px;
}
.sw-empty__icon--sm svg {
  width: 22px;
  height: 22px;
}
.sw-empty__icon--lg {
  width: 112px;
  height: 112px;
}
.sw-empty__icon--lg svg {
  width: 48px;
  height: 48px;
}
.sw-empty__title {
  font-size: 14px;
  line-height: 20px;
}
.sw-empty__title--lg {
  font-size: 22px;
  line-height: 28px;
}
.sw-empty__text {
  font-size: 12px;
  color: var(--sw-text-faint);
  line-height: 16px;
  max-width: 280px;
}
.sw-empty__text--lg {
  font-size: 14px;
  color: #6b7280;
  line-height: 20px;
  max-width: 420px;
}

.sw-chat__empty .sw-empty__title--lg + .sw-empty__text--lg {
  margin-top: -10px;
}

.sw-empty__cta {
  --bs-btn-border-width: 0;
  --bs-btn-font-size: 14px;
  --bs-btn-line-height: 20px;
  --bs-btn-padding-y: 13px;
  --bs-btn-padding-x: 22px;
}
.sw-empty__cta svg {
  width: 16px;
  height: 16px;
}

@media (max-width: 991.98px) {
  .sw-msg-app {
    display: block;
  }
  .sw-msg-app .sw-inbox,
  .sw-msg-app .sw-chat {
    border-radius: 0;
    border: 0;
    height: 100%;
  }

  .sw-msg-app[data-view="inbox"] .sw-chat {
    display: none;
  }
  .sw-msg-app[data-view="chat"] .sw-inbox {
    display: none;
  }

  .sw-msg-app.sw-msg-app--empty .sw-inbox {
    display: none;
  }
  .sw-msg-app.sw-msg-app--empty .sw-chat {
    display: flex;
  }
  .sw-msg-app--empty .sw-chat__empty {
    padding: 24px;
  }
  .sw-msg-app--empty {
    display: block;
  }
  .sw-msg-app--empty .sw-chat {
    display: none;
  }
}

@media (max-width: 575.98px) {
  .sw-chat__head {
    padding: 12px 16px;
  }
  .sw-chat__body {
    padding: 16px;
  }
  .sw-chat__composer {
    padding: 12px 16px;
  }
  .sw-msg-row {
    max-width: 85%;
  }
  .sw-chat__input-wrap {
    height: 44px;
  }
  .sw-chat__attach,
  .sw-chat__send {
    width: 44px;
    height: 44px;
  }
}
