.ib-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}
.admin-content:has(#inbox-app) {
  padding: 20px 28px 24px;
}
.admin-content:has(#inbox-app) > .page-title {
  margin-bottom: 16px;
}
.admin-content:has(#inbox-app) > .page-title h1 {
  font-size: 30px;
}
.admin-content:has(#inbox-app) > .page-title p {
  font-size: 12px;
  margin-top: 6px;
}
.ib-toolbar .tabs {
  margin-bottom: 12px;
}
.ib-source-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 0 0 12px;
  padding: 0 0 4px;
}
.ib-source-tabs button {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 9px 13px;
  border: 1px solid #e4e7e2;
  border-radius: 8px;
  background: white;
  color: #566153;
  cursor: pointer;
}
.ib-source-tabs button.active {
  background: #283a2e;
  color: white;
  border-color: #283a2e;
}
.ib-source-tabs small {
  font-size: 10px;
  opacity: 0.75;
}
.ib-avatar-notice {
  background: #fff6df;
  color: #765b29;
  padding: 10px 12px;
  border-radius: 6px;
  margin-bottom: 10px;
}
.ib-avatar {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  isolation: isolate;
}
.ib-avatar-fallback {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #e9ede7;
  display: grid;
  place-items: center;
  color: #9aa694;
  overflow: hidden;
}
.ib-avatar-fallback svg {
  width: 65%;
  height: 65%;
  fill: currentColor;
}
.ib-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
}
.ib-avatar img[hidden] {
  display: none;
}
.ib-avatar-channel {
  position: absolute;
  bottom: -2px;
  right: -3px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border: 2px solid white;
  border-radius: 6px;
  background: #6d7867;
  color: white;
  font-size: 13px;
  font-weight: 700;
  z-index: 2;
  font-style: normal;
  line-height: 1;
}
.ib-avatar-channel.facebook {
  background: #1877f2;
}
.ib-avatar-channel.instagram {
  background: linear-gradient(35deg, #ffb900, #ec3666, #913ddb);
}
.ib-avatar-channel.whatsapp {
  background: #159947;
}
.ib-contact-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.ib-contact-heading > div {
  min-width: 0;
}
.ib-avatar-header {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}
.ib-avatar-message {
  position: absolute;
  left: -35px;
  top: 0;
  width: 26px;
  height: 26px;
}
.ib-message.incoming {
  position: relative;
  margin-left: 35px;
  max-width: calc(88% - 35px);
}
.ib-layout {
  display: grid;
  grid-template-columns: 240px minmax(300px, 1fr) 280px;
  min-height: 420px;
  height: calc(100dvh - 300px);
  border: 1px solid #e5e7e8;
  border-radius: 12px;
  overflow: hidden;
  background: white;
}
.ib-inbox-list {
  border-right: 1px solid #e5e7e8;
  overflow: auto;
}
.ib-filters {
  padding: 14px;
  border-bottom: 1px solid #eceeed;
  display: grid;
  gap: 10px;
}
.ib-filters .fields {
  gap: 8px;
}
.ib-filters .field {
  margin: 0;
}
.ib-filters .field:has(select[name="filterChannel"]) {
  display: none;
}
.ib-filters input,
.ib-filters select {
  font-size: 12px;
  padding: 10px;
  min-width: 0;
}
.ib-filters label {
  font-size: 11px;
}
.ib-list-count {
  padding: 12px 14px;
  color: #7c8280;
  font-size: 12px;
}
.ib-thread-item {
  display: flex;
  align-items: flex-start;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #f0f1ef;
  background: white;
  text-align: left;
  gap: 10px;
  padding: 15px 12px;
  color: #242b27;
  cursor: pointer;
}
.ib-thread-item.active {
  background: #f0f4ef;
  border-left: 3px solid #5b6c58;
  padding-left: 9px;
}
.ib-thread-item:hover {
  background: #f7f8f6;
}
.ib-thread-avatar {
  background: #e9ede7;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 32px;
  font-weight: 600;
}
.ib-thread-item-body {
  min-width: 0;
  flex: 1;
}
.ib-thread-item strong {
  font-size: 13px;
  display: block;
}
.ib-thread-item small {
  font-size: 10px;
  color: #7a827a;
  display: block;
  margin-top: 4px;
}
.ib-thread-item p {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 6px;
  color: #737970;
}
.ib-unread {
  background: #283a2e;
  color: white;
  border-radius: 20px;
  padding: 2px 6px;
  font-size: 10px;
}
.ib-thread {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}
.ib-thread-header {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  border-bottom: 1px solid #eef0ed;
  flex-wrap: wrap;
}
.ib-thread-header h2 {
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
}
.ib-thread-header p {
  font-size: 11px;
  overflow-wrap: anywhere;
}
.ib-thread-header .btn {
  padding: 7px 10px;
  font-size: 11px;
}
.ib-thread-state {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  border-bottom: 1px solid #eef0ed;
}
.ib-thread-state .small {
  font-size: 11px;
}
.ib-thread-subject {
  flex-shrink: 0;
  padding: 8px 16px;
  background: #f7f8f5;
}
.ib-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  font-size: 11px;
  background: #f0f1ec;
  color: #53624e;
  line-height: 1.5;
}
.ib-chip.good {
  background: #e9f3e8;
  color: #3e6240;
}
.ib-context {
  border-left: 1px solid #e5e7e8;
  overflow: auto;
  background: #fcfcfb;
}
.ib-profile {
  padding: 20px;
}
.ib-profile h3 {
  font-size: 19px;
}
.ib-profile h2 {
  font-family: inherit;
  font-size: 17px;
  font-weight: 600;
}
.ib-address {
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ib-section-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin: 24px 0 12px;
  font-size: 12px;
}
.ib-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.ib-order {
  display: grid;
  grid-template-columns: 1fr auto;
  font-size: 12px;
  gap: 6px;
  padding: 12px 0;
  border-bottom: 1px solid #eceeeb;
}
.ib-order small {
  grid-column: 1/-1;
  color: #82887f;
  font-size: 10px;
}
.ib-customer-note {
  font-size: 12px;
  padding: 12px;
  background: #f2f3ed;
  margin-bottom: 10px;
  border-radius: 6px;
  white-space: pre-line;
  overflow-wrap: anywhere;
}
.ib-customer-note small {
  display: block;
  color: #82877e;
  font-size: 10px;
  margin-top: 8px;
}
.ib-message-list {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #f8f9f6;
}
.ib-message {
  max-width: 88%;
  width: fit-content;
  border: 1px solid #e7eae3;
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
  font-size: 13px;
  align-self: flex-start;
  overflow-wrap: anywhere;
}
.ib-message.outgoing {
  align-self: flex-end;
  background: #eaf1e6;
  border-color: #e0e8db;
}
.ib-message.private-note {
  align-self: center;
  background: #fff8dd;
  border-color: #efe7c7;
  width: 94%;
  max-width: 94%;
}
.ib-message p {
  white-space: pre-wrap;
  line-height: 1.7;
}
.ib-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 10px;
  color: #7c8477;
  margin-bottom: 6px;
}
.ib-message-status {
  display: block;
  text-align: right;
  margin-top: 8px;
  font-size: 10px;
  color: #7c8477;
}
.ib-message-status.bad,
.ib-message-error {
  color: #a33b36;
}
.ib-attachment {
  display: block;
  background: #edf0e8;
  padding: 8px;
  border-radius: 5px;
  margin-top: 8px;
  font-size: 11px;
}
.ib-compose {
  flex-shrink: 0;
  max-height: 65%;
  overflow: auto;
  padding: 12px 16px;
  background: white;
  border-top: 1px solid #e7e9e3;
}
.ib-compose textarea {
  resize: vertical;
  min-height: 82px;
  font-size: 13px;
  border: 0;
  background: #f6f7f3;
  margin-top: 8px;
  padding: 12px;
}
.ib-compose-tools {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.ib-compose-tools > button {
  border: 0;
  background: transparent;
  color: #90958a;
  font-size: 11px;
  padding: 4px 0;
  margin-right: 5px;
  cursor: pointer;
}
.ib-compose-tools > button.active {
  color: #293c2f;
  font-weight: 600;
}
.ib-compose-tools select {
  padding: 6px 8px;
  font-size: 11px;
  max-width: 210px;
  flex: 1;
  min-width: 120px;
}
.ib-compose footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.ib-compose footer .small {
  font-size: 10px;
}
.ib-compose-notice {
  font-size: 11px;
  background: #fff8de;
  color: #7d6d3d;
  margin-top: 10px;
  padding: 8px;
  border-radius: 6px;
}
.ib-linked-orders {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px;
  font-size: 11px;
}
.ib-linked-orders > span {
  display: flex;
  align-items: center;
  background: #edf2eb;
  margin-top: 8px;
  padding: 2px 6px;
}
.ib-linked-orders .icon-btn {
  height: 22px;
  width: 22px;
  font-size: 12px;
}
.ib-empty {
  display: flex;
  min-height: 190px;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 30px;
  text-align: center;
  color: #747e6f;
}
.ib-empty-icon {
  font-size: 38px;
  color: #b7c0af;
}
.ib-empty h3 {
  font-size: 22px;
  margin-top: 12px;
}
.ib-empty p {
  max-width: 350px;
  font-size: 12px;
  line-height: 1.9;
  margin-top: 10px;
}
.ib-inbox-list .ib-empty {
  padding: 18px;
}
.ib-inbox-list .ib-empty h3 {
  font-size: 18px;
}
.ib-channel-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.ib-channel-grid .panel-head {
  gap: 12px;
  flex-wrap: wrap;
}
.ib-channel-grid .panel-head h3 {
  font-size: 21px;
}
.ib-channel-grid .panel-body p {
  overflow-wrap: anywhere;
}
.ib-dialog {
  border: 1px solid #e6e9e1;
  border-radius: 14px;
  width: min(600px, calc(100vw - 30px));
  max-height: 90vh;
  padding: 0;
  margin: auto;
  color: #273025;
  box-shadow: 0 24px 100px #0003;
}
.ib-dialog::backdrop {
  background: #0006;
  backdrop-filter: blur(3px);
}
.ib-dialog header,
.ib-dialog footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #edf0e9;
}
.ib-dialog header h2 {
  font-size: 27px;
}
.ib-dialog footer {
  justify-content: flex-end;
  border-top: 1px solid #edf0e9;
  border-bottom: 0;
}
.ib-dialog-body {
  padding: 24px;
  max-height: 66vh;
  overflow: auto;
}
.ib-customer-options {
  max-height: 300px;
  overflow: auto;
  margin-top: 12px;
}
.ib-customer-option {
  display: block;
  text-align: left;
  width: 100%;
  border: 0;
  border-bottom: 1px solid #eee;
  background: white;
  padding: 12px;
  cursor: pointer;
}
.ib-customer-option:hover {
  background: #f0f4eb;
}
.ib-customer-option strong {
  display: block;
  font-size: 13px;
}
.ib-customer-option small {
  display: block;
  font-size: 11px;
  color: #83897d;
  margin-top: 5px;
}
.ib-reply-content {
  white-space: pre-line;
  max-width: 500px;
}
.ib-template-preview {
  white-space: pre-line;
  padding: 14px;
  background: #f3f5ef;
  font-size: 13px;
  margin-bottom: 16px;
}
.ib-crm-toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}
.ib-crm-toolbar > input {
  max-width: 440px;
  flex: 1;
}
.ib-crm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 20px;
}
.ib-crm-profile {
  max-height: 75vh;
  overflow: auto;
}
.ib-close-profile,
.ib-mobile-back {
  display: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 1450px) {
  .ib-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }
  .ib-context {
    display: none;
  }
  .ib-details-open .ib-context {
    display: block;
    position: fixed;
    right: 20px;
    top: 100px;
    bottom: 24px;
    width: 330px;
    border: 1px solid #e0e5da;
    border-radius: 12px;
    box-shadow: 0 16px 60px #0002;
    z-index: 40;
  }
  .ib-close-profile {
    display: inline-flex;
  }
  .ib-crm-layout {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}
@media (max-width: 850px) {
  .ib-crm-layout {
    grid-template-columns: 1fr;
  }
  .ib-crm-profile {
    max-height: none;
  }
  .ib-channel-grid {
    grid-template-columns: 1fr;
  }
  .ib-layout {
    grid-template-columns: 210px minmax(0, 1fr);
  }
  .ib-thread-header {
    padding: 12px;
  }
  .ib-toolbar {
    flex-wrap: wrap;
  }
  .ib-toolbar .tabs {
    margin-bottom: 10px;
  }
  .ib-thread-state {
    gap: 8px;
  }
  .ib-compose-tools {
    gap: 6px;
  }
  .ib-compose footer {
    align-items: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 650px) {
  .ib-layout {
    grid-template-columns: 1fr;
    height: calc(100vh - 250px);
    min-height: 570px;
  }
  .ib-inbox-list {
    display: block;
    border: 0;
  }
  .ib-thread {
    display: none;
  }
  .ib-has-conversation .ib-inbox-list {
    display: none;
  }
  .ib-has-conversation .ib-thread {
    display: flex;
  }
  .ib-mobile-back {
    display: block;
    margin-bottom: 8px;
  }
  .ib-thread-header h2 {
    font-size: 16px;
  }
  .ib-thread-header .btn {
    font-size: 10px;
  }
  .ib-message {
    max-width: 95%;
  }
  .ib-message-list {
    padding: 14px;
  }
  .ib-details-open .ib-context {
    right: 10px;
    left: 10px;
    top: 110px;
    bottom: 20px;
    width: auto;
  }
  .ib-compose {
    padding: 10px;
  }
  .ib-crm-toolbar {
    flex-wrap: wrap;
  }
  .ib-toolbar .local-pill {
    display: none;
  }
  .ib-dialog-body {
    padding: 18px;
  }
  .ib-dialog header,
  .ib-dialog footer {
    padding: 16px 18px;
  }
}
