.conversation-list {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
}

.conversation-list__top {
  display: grid;
  gap: 10px;
  padding: 14px var(--list-gutter) 0;
  border-bottom: 1px solid var(--border);
}

.conversation-list__header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.conversation-list__header .icon-btn {
  position: relative;
  width: 36px;
  height: 36px;
}

.icon-btn.is-active {
  color: var(--gold-700);
  background: var(--surface-active);
}

.icon-btn__badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--radius-full);
  font-size: var(--fs-2xs);
  font-weight: 700;
  line-height: 16px;
  color: #fff;
  background: var(--gold-700);
}

.conversation-list__title {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xl);
  font-weight: 700;
}

.presence-toggle {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}

.presence-toggle:hover {
  background: var(--surface-muted);
}

.presence-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-faint);
}

.presence-dot--online {
  background: var(--green-500);
  box-shadow: 0 0 0 3px var(--green-100);
}
.presence-dot--away {
  background: var(--orange-500);
  box-shadow: 0 0 0 3px var(--orange-100);
}
.presence-dot--offline {
  background: var(--text-faint);
  box-shadow: 0 0 0 3px var(--surface-muted);
}

.search {
  position: relative;
}

.search__icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.search__input {
  width: 100%;
  height: 36px;
  padding: 0 38px 0 40px;
  border-radius: var(--radius-md);
  background: var(--surface-cream);
  border: 1px solid var(--border);
}

.search__input::placeholder {
  color: var(--text-muted);
}

.search__input:focus {
  outline: none;
  border-color: var(--gold-500);
  box-shadow: var(--focus-ring);
}

.search__clear {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.search__clear:hover {
  background: var(--surface-pill);
}

.inbox-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-inline: calc(var(--list-gutter) * -1);
}

.inbox-tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: 8px 4px 9px;
  font-size: var(--fs-xs);
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  transition:
    color var(--duration) var(--ease),
    border-color var(--duration) var(--ease);
}

.inbox-tab__icon {
  width: 22px;
  height: 22px;
}

.inbox-tab:hover {
  color: var(--text);
}

.inbox-tab[aria-selected="true"] {
  font-weight: 700;
  color: var(--gold-700);
  border-bottom-color: var(--gold-600);
}

.filter-panel {
  display: grid;
  gap: 12px;
  padding: 12px var(--list-gutter) 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--border);
}

.filter-panel__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filter-panel__actions {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 10px;
  margin-top: 2px;
}

.conversation-list__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--list-gutter);
  font-size: var(--fs-md);
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-muted);
}

.conversation-list__meta strong {
  color: var(--text);
}

.spam-banner {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px var(--list-gutter);
  font-size: var(--fs-sm);
  color: var(--orange-600);
  background: var(--orange-100);
  border-bottom: 1px solid #f5dfb8;
}

.conversation-list__items {
  flex: 1;
  overflow-y: auto;
}

.conversation-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px var(--list-gutter) 12px 10px;
  border-bottom: 1px solid var(--border-soft);
  transition: background var(--duration) var(--ease);
}

.conversation-row:hover {
  background: var(--surface-soft);
}

.conversation-row.is-selected {
  background: var(--surface-active);
}

.conversation-row__hit {
  position: absolute;
  inset: 0;
}

.conversation-row__hit:focus-visible {
  box-shadow: inset var(--focus-ring);
}

/* The whole row is one hit target; only nested row actions stay independently clickable. */
.conversation-row > :not(.conversation-row__hit) {
  pointer-events: none;
}

.conversation-row .row-action {
  position: relative;
  z-index: 1;
  pointer-events: auto;
}

.conversation-row.is-selected::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--gold-500);
  content: "";
}

.conversation-row.is-faded .conversation-row__name,
.conversation-row.is-faded .conversation-row__preview {
  color: var(--text-faint);
}

.conversation-row__channel {
  display: grid;
  align-self: center;
  flex-shrink: 0;
}

.conversation-row__body {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.unread-dot {
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red-500);
}

.reply-state {
  flex-shrink: 0;
  font-size: var(--fs-sm);
  font-weight: 600;
}

.reply-state--unserved {
  color: var(--red-500);
}

.reply-state--served {
  color: var(--green-500);
}

.reply-state--resolved {
  color: var(--text-muted);
}

.conversation-row__line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.conversation-row__name {
  overflow: hidden;
  font-size: var(--fs-base);
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-row__pin {
  color: var(--gold-600);
}

.conversation-row__time {
  margin-left: auto;
  flex-shrink: 0;
  font-size: var(--fs-sm);
  color: var(--text-muted);
}

.conversation-row__preview {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  font-size: var(--fs-md);
  color: var(--text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-row.is-unread .conversation-row__name,
.conversation-row.is-unread .conversation-row__preview {
  font-weight: 700;
  color: var(--text);
}

.conversation-row__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.row-action {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--gold-700);
  background: #f6eedd;
  border: 1px solid #ecdcbc;
}

.row-action:hover {
  background: #efe1c4;
}

.row-action--neutral {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface);
  border-color: var(--border);
}

.row-action--neutral:hover {
  background: var(--surface-soft);
}

.tag--iklan {
  color: var(--purple-500);
  background: var(--purple-100);
}
.tag--kampanye {
  color: var(--blue-500);
  background: var(--blue-100);
}
.tag--deal {
  color: var(--green-500);
  background: var(--green-100);
}
.tag--no-deal {
  color: var(--text-muted);
  background: var(--surface-muted);
}
.tag--spam,
.tag--red {
  color: var(--red-500);
  background: var(--red-100);
}
.tag--blue {
  color: var(--blue-500);
  background: var(--blue-100);
}
.tag--purple {
  color: var(--purple-500);
  background: var(--purple-100);
}
.tag--green {
  color: var(--green-500);
  background: var(--green-100);
}
.tag--gold {
  color: var(--gold-700);
  background: #f6eedd;
}

.conversation-list__footer {
  border-top: 1px solid var(--border);
}

.inbox-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 48px;
  font-size: var(--fs-base);
  color: var(--text-secondary);
}

.inbox-footer:hover {
  background: var(--surface-soft);
}

.inbox-footer strong {
  color: var(--red-500);
}

.inbox-footer__info {
  display: inline-grid;
  color: var(--text-muted);
}

.empty-state {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 56px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state__icon {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: 4px;
  border-radius: 50%;
  color: var(--gold-700);
  background: var(--surface-muted);
}

.empty-state__title {
  font-weight: 700;
  color: var(--text);
}
