/* Shared complaint messaging UI (B2B / supplier / central) */
.tb-inbox-icons {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.35rem;
}
.tb-inbox-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #e8eef6;
  cursor: pointer;
  padding: 0;
}
.tb-inbox-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}
.tb-inbox-btn svg {
  width: 1.15rem;
  height: 1.15rem;
}
.tb-inbox-btn__badge {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
  box-shadow: 0 0 0 2px #0f2744;
}
.tb-inbox-btn__badge.is-on {
  display: inline-flex;
}

.tb-inbox-panel-theme--light .tb-inbox-btn {
  border-color: #e2e8f0;
  background: #fff;
  color: #64748b;
}
.tb-inbox-panel-theme--light .tb-inbox-btn:hover {
  background: #f8fafc;
}
.tb-inbox-panel-theme--light .tb-inbox-btn__badge {
  box-shadow: 0 0 0 2px #fff;
}

.tb-msg-overlay {
  position: fixed;
  inset: 0;
  z-index: 12000;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tb-msg-overlay.hidden {
  display: none !important;
}
.tb-msg-dialog {
  width: min(640px, 100%);
  max-height: min(88vh, 760px);
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: #1e293b;
}
.tb-msg-dialog--list {
  width: min(420px, 100%);
  max-height: min(70vh, 560px);
}
.tb-msg-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.1rem 0.75rem;
  border-bottom: 1px solid #e2e8f0;
}
.tb-msg-dialog__head h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
}
.tb-msg-dialog__sub {
  margin: 0.25rem 0 0;
  font-size: 0.8rem;
  color: #64748b;
}
.tb-msg-dialog__close {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.tb-msg-dialog__close:hover {
  color: #0f172a;
}
.tb-msg-thread {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.1rem;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 180px;
}
.tb-msg-bubble {
  max-width: 88%;
  border-radius: 12px;
  padding: 0.65rem 0.8rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  align-self: flex-start;
}
.tb-msg-bubble--mine {
  align-self: flex-end;
  background: #ecfdf5;
  border-color: #a7f3d0;
}
.tb-msg-bubble__meta {
  font-size: 0.68rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}
.tb-msg-bubble__body {
  font-size: 0.9rem;
  white-space: pre-wrap;
  word-break: break-word;
  color: #1e293b;
}
.tb-msg-attach-list {
  margin: 0.4rem 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.tb-msg-attach-list a {
  font-size: 0.75rem;
  color: #0369a1;
  text-decoration: underline;
}
.tb-msg-compose {
  border-top: 1px solid #e2e8f0;
  padding: 0.85rem 1.1rem 1rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.tb-msg-compose textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  font: inherit;
  font-size: 0.9rem;
}
.tb-msg-compose__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.tb-msg-compose__files {
  font-size: 0.75rem;
  color: #64748b;
}
.tb-msg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: #334155;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.45rem 0.85rem;
  cursor: pointer;
}
.tb-msg-btn--primary {
  background: #0f766e;
  border-color: #0f766e;
  color: #fff;
}
.tb-msg-btn--primary:hover {
  background: #0d9488;
}
.tb-msg-btn--ghost:hover {
  background: #f1f5f9;
}
.tb-msg-list {
  overflow-y: auto;
  flex: 1;
  min-height: 120px;
}
.tb-msg-list-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid #e2e8f0;
  background: #fff;
  padding: 0.85rem 1.1rem;
  cursor: pointer;
  font: inherit;
}
.tb-msg-list-item:hover {
  background: #f8fafc;
}
.tb-msg-list-item.is-unread {
  background: #eff6ff;
}
.tb-msg-list-item__title {
  display: block;
  font-size: 0.9rem;
  font-weight: 650;
  color: #0f172a;
}
.tb-msg-list-item__meta {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  color: #64748b;
}
.tb-msg-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}
.tb-msg-err {
  color: #b91c1c;
  font-size: 0.8rem;
  margin: 0;
}
.hidden {
  display: none !important;
}
