/* ==========================================================================
   GELEX HUB — Hộp thư (Inbox) — Enterprise redesign
   List item có icon enterprise, unread dot, filter pill gọn.
   ========================================================================== */

/* Filter pills — segmented style gọn */
.ib-filters {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
  padding: 4px;
  background: var(--surface-sunken);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.ib-filter {
  padding: 6px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background var(--ease) 120ms, color var(--ease) 120ms;
}
.ib-filter:hover { color: var(--text); }
.ib-filter.active {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.ib-filter-count {
  background: var(--border);
  color: var(--text-2);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.ib-filter.active .ib-filter-count { background: var(--brand); color: #fff; }

/* Item list — card container */
.ib-list {
  display: flex;
  flex-direction: column;
  background: var(--surface-raised);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.ib-group + .ib-group { border-top: 1px solid var(--border); }
.ib-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px 8px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.ib-group-count {
  background: var(--surface-sunken);
  color: var(--text-2);
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
}
.ib-group-list { display: flex; flex-direction: column; }
.ib-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 96px 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background var(--ease) 100ms, opacity 140ms ease, transform 140ms ease;
  position: relative;
}
.ib-item:last-child { border-bottom: none; }
.ib-item:hover { background: var(--surface-sunken); }
.ib-item.unread { background: #fffafb; }
.ib-item.unread:hover { background: #fef2f2; }
.ib-item.unread::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--brand);
}

/* Icon enterprise */
.ib-ic {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--surface-sunken);
  color: var(--text-3);
  flex: none;
}
.ib-item:hover .ib-ic { background: var(--surface-raised); }
.ib-item.unread .ib-ic { background: var(--brand-soft); color: var(--brand-dark); }
.ib-item.danger .ib-ic { background: #fef2f2; color: var(--danger); }
.ib-item.warning .ib-ic { background: var(--surface-sunken); color: var(--brand-dark); }
.ib-item.accent .ib-ic { background: #fffbeb; color: #d97706; }
.ib-item.info .ib-ic { background: var(--brand-soft); color: var(--brand-dark); }

/* Body */
.ib-body { flex: 1; min-width: 0; }
.ib-title {
  font-size: 13.5px;
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.3;
}
.ib-item.unread .ib-title { font-weight: 600; }
.ib-meta {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ib-kind {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--surface-sunken);
  color: var(--text-3);
}
.ib-item.danger .ib-kind { background: #fef2f2; color: var(--danger); }
.ib-item.warning .ib-kind { background: var(--surface-sunken); color: var(--text-2); }
.ib-item.accent .ib-kind { background: #fffbeb; color: #b45309; }
.ib-item.info .ib-kind { background: var(--brand-soft); color: var(--brand-dark); }

/* Time + unread dot */
.ib-time {
  font-size: 11.5px;
  color: var(--text-3);
  flex: none;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
  min-width: 70px;
}
.ib-unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  flex: none;
  margin-top: 4px;
}

.ib-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  display: flex;
  gap: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--ease) 120ms, transform var(--ease) 120ms;
}
.ib-item:hover .ib-actions,
.ib-item:focus-within .ib-actions {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(-50%);
}
.ib-action {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-raised);
  color: var(--text-3);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background var(--ease) 120ms, color var(--ease) 120ms, border-color var(--ease) 120ms;
}
.ib-action:hover { background: var(--surface-sunken); color: var(--text); border-color: var(--border-strong); }
.ib-action-read:hover { color: var(--brand-dark); }
.ib-action-dismiss:hover { color: var(--danger); }
.ib-action svg { width: 14px; height: 14px; }

.ib-more-row {
  display: flex;
  justify-content: center;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--border);
}
.ib-empty-state {
  padding: 38px 24px;
  text-align: center;
}
.ib-empty-action {
  border: none;
  background: transparent;
  color: var(--brand-dark);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 4px;
  padding: 0;
}
.ib-empty-action:hover { color: var(--brand); text-decoration: underline; }
.ib-item.ib-dismissing { opacity: 0.55; }

/* Mobile */
@media (max-width: 560px) {
  .ib-item { flex-wrap: wrap; padding: 10px 12px; }
  .ib-actions {
    position: static;
    margin-left: auto;
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }
  .ib-time { margin-left: auto; min-width: auto; }
  .ib-filter { padding: 5px 11px; font-size: 12px; }
  .ib-group-head { padding: 10px 12px 6px; }
}
