/*
 * Final layout refinements for the Documents page.
 * Kept page-scoped so shared header/footer styles on other pages are untouched.
 */

/* Footer leadership card */
.documents-page-active .footer-sub-contacts {
  padding: 18px 20px 10px;
  border-radius: 14px;
  background: rgba(112, 0, 0, .2);
}

.documents-page-active .footer-sub-contacts .sub-contact-title {
  padding-bottom: 14px;
  font-size: .82rem;
  letter-spacing: .02em;
}

.documents-page-active .footer-members-list {
  display: grid;
}

.documents-page-active .footer-members-list li {
  min-height: 62px;
  padding: 13px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  font-size: .76rem;
}

.documents-page-active .footer-members-list li > div {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px;
  line-height: 1.45;
}

.documents-page-active .footer-member-role {
  white-space: nowrap;
}

.documents-page-active .footer-member-name {
  min-width: 0;
  color: rgba(255, 255, 255, .96);
  font-weight: 600;
}

.documents-page-active .footer-member-phone {
  width: max-content;
  min-width: 112px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 246, 0, .22);
  border-radius: 7px;
  background: rgba(255, 246, 0, .08);
  white-space: nowrap;
  text-align: center;
  letter-spacing: .01em;
}

/* Keep document numbers on one line on desktop without widening the table. */
.documents-page-active .documents-table .col-number {
  width: 116px;
}

.documents-page-active .documents-table td:nth-child(2) {
  white-space: nowrap;
}

@media (max-width: 820px) {
  /* Stronger hierarchy for the mobile list heading. */
  .documents-page-active .documents-list-card {
    overflow: hidden;
    border-radius: 14px;
  }

  .documents-page-active .documents-list-heading {
    padding: 16px 16px 14px;
    gap: 14px;
    border-bottom: 1px solid #e8ebf1;
  }

  .documents-page-active .documents-list-heading h2 {
    font-size: 1rem;
    line-height: 1.3;
  }

  .documents-page-active .documents-list-heading p {
    display: block;
    margin-top: 4px;
    font-size: .75rem;
    line-height: 1.45;
  }

  .documents-page-active .documents-sort {
    padding-top: 2px;
    font-size: .75rem;
  }

  .documents-page-active .documents-sort select {
    min-width: 128px;
    height: 42px;
    border-radius: 9px;
    font-size: .76rem;
  }

  .documents-page-active .documents-table-wrap {
    overflow: visible;
    padding: 12px;
    background: #f7f9fc;
  }

  .documents-page-active .documents-table tbody {
    padding: 0;
    display: grid;
    gap: 12px;
  }

  .documents-page-active .documents-table tbody tr {
    margin: 0;
    padding: 18px 16px 16px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 12px;
    border: 1px solid #e2e7ef;
    border-radius: 13px;
    background: #fff;
    box-shadow: 0 5px 16px rgba(15, 23, 42, .055);
  }

  .documents-page-active .documents-table tbody tr:hover {
    transform: none;
    background: #fff;
  }

  .documents-page-active .documents-table td {
    width: auto;
    min-width: 0;
    margin: 0;
    padding: 0 !important;
  }

  .documents-page-active .documents-table td:nth-child(1) {
    position: static;
    grid-column: 2;
    grid-row: 1;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #fff0f0;
    color: #c60000;
    font-size: .72rem;
  }

  .documents-page-active .documents-table td:nth-child(2) {
    grid-column: 1;
    grid-row: 1;
    align-self: center;
    padding-right: 0 !important;
    color: #111c32;
    font-size: .9rem;
    line-height: 1.3;
    white-space: nowrap;
  }

  .documents-page-active .documents-table td:nth-child(3) {
    grid-column: 1 / -1;
    margin-top: 9px;
  }

  .documents-page-active .document-type {
    min-height: 27px;
    padding: 5px 9px;
    border-radius: 7px;
    font-size: .68rem;
    letter-spacing: .015em;
  }

  .documents-page-active .documents-table td:nth-child(4) {
    grid-column: 1 / -1;
    margin-top: 14px;
    padding-top: 13px !important;
    border-top: 1px solid #edf0f5 !important;
    color: #344054;
    font-size: .8rem;
    line-height: 1.58;
  }

  .documents-page-active .documents-table td:nth-child(5),
  .documents-page-active .documents-table td:nth-child(6) {
    grid-row: 4;
    margin-top: 14px;
    display: flex;
    align-items: center;
    color: #596579;
    font-size: .72rem;
    line-height: 1.35;
  }

  .documents-page-active .documents-table td:nth-child(5) {
    grid-column: 1;
  }

  .documents-page-active .documents-table td:nth-child(6) {
    grid-column: 2;
    justify-self: end;
  }

  .documents-page-active .documents-table td:nth-child(5)::before {
    content: "Ban hành:";
    margin-right: 5px;
    color: #27344a;
    font-weight: 700;
  }

  .documents-page-active .documents-table td:nth-child(6)::before {
    content: "Hiệu lực:";
    margin: 0 5px 0 0;
    color: #27344a;
    font-weight: 700;
  }

  .documents-page-active .documents-table td:nth-child(7) {
    grid-column: 1 / -1;
    margin-top: 14px;
  }

  .documents-page-active .documents-download {
    min-height: 43px;
    border-radius: 9px;
    background: #fff;
    font-size: .76rem;
    font-weight: 700;
  }

  .documents-page-active .documents-download:not(.is-disabled):hover {
    background: #c90000;
    color: #fff;
  }

  .documents-page-active .documents-pagination {
    padding: 13px 14px;
    background: #fff;
  }

  /* The leadership card remains balanced after the footer stacks. */
  .documents-page-active .footer-sub-contacts {
    padding: 15px;
  }

  .documents-page-active .footer-members-list li {
    min-height: 0;
    padding: 12px 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    gap: 7px;
    font-size: .72rem;
    text-align: left;
  }

  .documents-page-active .footer-members-list li > div {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .documents-page-active .footer-member-phone {
    min-width: 94px;
    font-size: .72rem;
  }
}

@media (max-width: 430px) {
  .documents-page-active .documents-table-wrap {
    padding: 10px;
  }

  .documents-page-active .documents-table tbody tr {
    padding: 16px 14px 14px;
  }

  .documents-page-active .documents-table td:nth-child(4) {
    font-size: .77rem;
  }

  .documents-page-active .documents-table td:nth-child(5),
  .documents-page-active .documents-table td:nth-child(6) {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 10px;
  }

  .documents-page-active .documents-table td:nth-child(5) {
    grid-row: 4;
  }

  .documents-page-active .documents-table td:nth-child(6) {
    grid-row: 5;
  }

  .documents-page-active .documents-table td:nth-child(7) {
    grid-row: 6;
  }
}
