.representative-page {
  padding-bottom: 48px;
}

/* Header block: phẳng, ít trang trí */
.representative-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  align-items: end;
  margin-bottom: 18px;
  padding: 22px 0 20px;
  border-bottom: 1px solid var(--line);
}

.representative-summary__content {
  max-width: 860px;
  min-width: 0;
}

.representative-summary__label {
  display: block;
  margin-bottom: 6px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.representative-summary h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.22;
  letter-spacing: -.035em;
}

.representative-summary p {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.representative-summary__count {
  min-width: 130px;
  padding-left: 22px;
  border-left: 1px solid var(--line);
  text-align: right;
}

.representative-summary__count strong,
.representative-summary__count span {
  display: block;
}

.representative-summary__count strong {
  margin: 1px 0;
  color: var(--text);
  font-size: 30px;
  line-height: 1.1;
}

.representative-summary__count span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

/* Directory: bỏ card lớn */
.representative-directory {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.representative-directory__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 10px;
}

.representative-directory__header > div {
  min-width: 0;
}

.representative-directory__header h2 {
  margin: 0;
  color: var(--text);
  font-size: 20px;
  line-height: 1.35;
}

.representative-directory__header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.representative-directory__total {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

/* Danh sách: kiểu directory rows thay vì các card nổi */
.representative-enterprise-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.representative-enterprise {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 19px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.representative-enterprise:hover {
  background: var(--surface-soft);
}

.representative-enterprise__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.representative-enterprise__identity {
  min-width: 0;
}

.representative-enterprise__name {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.45;
  text-transform: uppercase;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.representative-enterprise__name:hover {
  color: var(--primary);
}

.representative-enterprise__tax {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.representative-enterprise__tax a {
  color: var(--primary-dark);
  font-weight: 800;
}

/* Status: vẫn giữ nhãn nhưng giảm "pill" */
.representative-status {
  flex: 0 0 auto;
  max-width: 150px;
  padding: 2px 0;
  border-radius: 0;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.3;
  text-align: right;
}

.status-active {
  color: var(--success);
}

.status-suspended {
  color: var(--warning);
}

.status-inactive,
.status-closed {
  color: #b42318;
}

.status-unknown {
  color: #667483;
}

.representative-enterprise__details {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.representative-detail {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.representative-detail svg {
  flex: 0 0 15px;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  fill: #82909b;
}

.representative-detail span {
  min-width: 0;
}

.representative-detail--address span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.representative-enterprise__footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.representative-head-office {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--primary-dark);
  font-weight: 800;
}

.representative-enterprise__view {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

/* Pagination: giảm pill */
.representative-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 22px;
}

.representative-pagination__pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.representative-pagination__pages a,
.representative-pagination__pages span,
.representative-pagination__nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.representative-pagination__pages a:hover,
.representative-pagination__nav:hover {
  color: var(--primary);
}

.representative-pagination__pages span[aria-current="page"] {
  border-bottom-color: var(--primary);
  color: var(--primary-dark);
}

/* Empty */
.representative-empty {
  padding: 36px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
}

.representative-empty p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* Note: chỉ là dòng chú thích */
.representative-note {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.representative-note strong {
  color: var(--text);
}

.representative-note p {
  margin: 3px 0 0;
}

/* Tablet */
@media (max-width: 820px) {
  .representative-summary {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .representative-summary__count {
    padding-left: 0;
    border-left: 0;
    text-align: left;
  }

  .representative-enterprise-list {
    grid-template-columns: 1fr;
  }
}

/* Mobile */
@media (max-width: 560px) {
  .representative-page {
    padding-bottom: 36px;
  }

  .representative-summary {
    padding: 16px 0 18px;
  }

  .representative-summary h1 {
    font-size: 24px;
  }

  .representative-directory__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .representative-enterprise {
    padding: 15px 14px;
  }

  .representative-enterprise__top {
    display: block;
  }

  .representative-status {
    display: block;
    margin-top: 7px;
    text-align: left;
  }

  .representative-enterprise__view {
    width: 100%;
    margin-left: 0;
  }

  .representative-pagination {
    flex-wrap: wrap;
  }

  .representative-pagination__pages {
    order: -1;
    width: 100%;
    justify-content: center;
    overflow-x: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .representative-enterprise {
    transition: none;
  }
}