.erp-chat-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1090;
  font-size: 14px;
}

.erp-chat-fab {
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.32);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.erp-chat-fab svg {
  width: 22px;
  height: 22px;
}

.erp-chat-fab-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 14px rgba(239, 68, 68, 0.35);
}

.erp-chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(920px, calc(100vw - 28px));
  height: min(650px, calc(100vh - 110px));
  background: rgba(255,255,255,0.98);
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 18px;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.24);
  overflow: hidden;
}

.erp-chat-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.erp-chat-kicker {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.erp-chat-title {
  font-size: 18px;
  font-weight: 900;
  margin: 0;
  color: #0f172a;
}

.erp-chat-tabs {
  display: flex;
  gap: 8px;
  padding: 0 14px 12px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.erp-chat-tab {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: #fff;
  color: #334155;
  border-radius: 999px;
  padding: 7px 12px;
  font-weight: 700;
}

.erp-chat-tab.is-active {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}

.erp-chat-body {
  height: calc(100% - 94px);
  overflow: hidden;
}

.erp-chat-view {
  height: 100%;
  padding: 12px 14px 14px;
}

.erp-chat-search {
  margin-bottom: 10px;
}

.erp-chat-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 12px;
  height: calc(100% - 44px);
}

.erp-chat-list,
.erp-chat-thread {
  min-height: 0;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
}

.erp-chat-list {
  overflow: auto;
  padding: 10px;
}

.erp-chat-item {
  padding: 10px 12px;
  border-radius: 12px;
  margin-bottom: 8px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.erp-chat-item.is-active {
  background: rgba(37, 99, 235, 0.08);
  border-color: rgba(37, 99, 235, 0.22);
}

.erp-chat-thread {
  display: grid;
  grid-template-rows: auto 1fr auto;
  overflow: hidden;
}

.erp-chat-thread-header {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  font-weight: 800;
  color: #0f172a;
}

.erp-chat-thread-messages {
  padding: 14px;
  overflow: auto;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.erp-chat-bubble {
  max-width: 78%;
  padding: 10px 12px;
  border-radius: 14px;
  margin-bottom: 10px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.erp-chat-bubble.mine {
  margin-left: auto;
  background: #2563eb;
  color: #fff;
  border-bottom-right-radius: 6px;
}

.erp-chat-bubble.other {
  background: #e2e8f0;
  color: #0f172a;
  border-bottom-left-radius: 6px;
}

.erp-chat-compose {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.erp-chat-empty {
  color: #64748b;
  text-align: center;
  padding: 20px 10px;
}

@media (max-width: 992px) {
  .erp-chat-panel {
    width: min(100vw - 18px, 520px);
    height: min(720px, calc(100vh - 90px));
  }

  .erp-chat-layout {
    grid-template-columns: 1fr;
    grid-template-rows: 180px 1fr;
  }
}

@media (max-width: 576px) {
  .erp-chat-widget {
    right: 10px;
    bottom: 10px;
  }

  .erp-chat-panel {
    width: calc(100vw - 20px);
    height: calc(100vh - 96px);
  }
}

.premium-quick-access-shell {
  bottom: 88px;
  margin-right: 18px;
}

@media (max-width: 576px) {
  .premium-quick-access-shell {
    bottom: 78px;
    margin-right: 10px;
  }
}
