/* Contact */
.contact-page .contact-card {
  max-width: 900px;
  margin: 48px auto 0;
  background: var(--color-card-bg);
  border-radius: var(--card-radius);
  padding: 32px 40px 40px;
}

.contact-card__title {
  margin: 0 0 24px;
  font-size: 28px;
  color: var(--color-orange);
}

.contact-card__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.contact-card__box {
  background: var(--color-white);
  border-radius: var(--card-radius);
  padding: 24px;
  font-size: 14px;
  line-height: 1.8;
}

.contact-card__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Employees list */
.employees-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.employees-toolbar__search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-white);
  border-radius: var(--card-radius);
  padding: 8px 14px;
  min-width: 200px;
}

.employees-toolbar__search input {
  border: none;
  background: transparent;
  outline: none;
  flex: 1;
  font-size: 14px;
}

.employees-table__head,
.employees-table__row {
  display: grid;
  grid-template-columns: 48px 1fr 1.2fr 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.employees-table__head {
  font-size: 15px;
  font-weight: 500;
  color: var(--color-text-dark);
  padding: 0 4px;
}

.employees-table__avatar {
  width: 40px;
  height: 40px;
  background: var(--color-blue);
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
}

.employees-table__avatar svg {
  width: 22px;
  height: 22px;
}

.employees-table__cell {
  background: var(--color-white);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.employees-table__cell--muted {
  color: var(--color-text);
  font-size: 15px;
}

.employees-table__cell--onhold {
  color: var(--color-red);
}

/* Forms list */
.forms-table__head,
.forms-table__row {
  display: grid;
  grid-template-columns: 1.4fr 1.2fr 60px;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.forms-table__head {
  font-size: 15px;
  font-weight: 500;
  padding: 0 4px;
}

.forms-table__cell {
  background: var(--color-white);
  border-radius: var(--card-radius);
  padding: 12px 14px;
  font-size: 14px;
  text-decoration: none;
  color: inherit;
  display: block;
}

.forms-table__title {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
}

.forms-table__title:hover {
  text-decoration: underline;
}

.forms-table__links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  margin-top: 6px;
  font-size: 12px;
  font-style: italic;
}

.forms-table__links a {
  color: var(--color-blue, #4a7fd4);
  text-decoration: none;
}

.forms-table__links a:hover {
  text-decoration: underline;
}

.forms-table__cell-sub {
  font-size: 12px;
  color: var(--color-text);
  font-style: italic;
  margin-top: 4px;
}

.forms-table__status {
  background: var(--color-white);
  border-radius: var(--card-radius);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Profile */
.profile-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
}

.profile-card {
  background: var(--color-orange);
  border-radius: var(--card-radius);
  padding: 24px;
  color: var(--color-white);
}

.profile-card__avatar-wrap {
  position: relative;
  width: 120px;
  margin-bottom: 20px;
}

.profile-card__avatar {
  width: 120px;
  height: 120px;
  background: var(--color-blue);
  border-radius: var(--card-radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-card__avatar svg {
  width: 60px;
  height: 60px;
  color: var(--color-white);
}

.profile-card__edit {
  position: absolute;
  bottom: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  background: var(--color-orange);
  border: 2px solid var(--color-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
}

.profile-contracts__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.profile-contracts__empty {
  margin: 0;
  color: var(--color-text);
}

.profile-card .field label {
  color: var(--color-white);
}

.profile-card .field input {
  background: var(--color-white);
}

.profile-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}

.profile-contracts {
  grid-column: 2;
  grid-row: 1 / span 2;
}

.profile-contract-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  margin-bottom: 8px;
  background: var(--color-orange);
  color: var(--color-white);
  border: none;
  border-radius: var(--card-radius);
  font-size: 15px;
  text-align: left;
}

.profile-contract-btn__icon {
  width: 24px;
  height: 24px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 2px;
}

.profile-save {
  grid-column: 2;
  display: flex;
  justify-content: flex-end;
  align-items: flex-end;
}

.profile-mail-settings {
  grid-column: 1 / -1;
  margin-top: 8px;
  padding-top: 24px;
  border-top: 1px solid #e5e5e0;
}

.profile-mail-settings__title {
  margin: 0 0 8px;
  font-size: 1.125rem;
}

.profile-mail-settings__hint {
  margin: 0 0 16px;
  color: var(--color-text-muted, #56554d);
  font-size: 0.9rem;
}

.profile-mail-settings__password-hint {
  display: block;
  margin-top: 4px;
  color: var(--color-text-muted, #56554d);
  font-size: 0.85rem;
}

.profile-mail-settings__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.profile-mail-settings .field select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d8d8d3;
  border-radius: 6px;
  font: inherit;
}

@media (max-width: 1100px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .contact-card__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .contact-page .contact-card {
    margin-top: 24px;
    padding: 24px 20px 28px;
  }

  .contact-card__title {
    font-size: 22px;
  }

  .contact-card__actions {
    align-items: stretch;
  }

  .contact-card__actions .btn {
    width: 100%;
    text-align: center;
  }

  /* Employees list — card rows */
  .employees-toolbar {
    flex-wrap: wrap;
    width: 100%;
  }

  .employees-toolbar__search {
    flex: 1 1 100%;
    min-width: 0;
  }

  .employees-table__head {
    display: none;
  }

  .employees-table__row {
    grid-template-columns: 44px 1fr;
    grid-template-areas:
      "avatar name"
      "avatar email"
      "avatar dept";
    gap: 4px 12px;
    padding: 12px 14px;
    background: var(--color-white);
    border-radius: var(--card-radius);
    align-items: start;
  }

  .employees-table__avatar {
    grid-area: avatar;
  }

  .employees-table__row > a.employees-table__cell {
    grid-area: name;
  }

  .employees-table__row > .employees-table__cell--muted {
    grid-area: email;
  }

  .employees-table__row > .employees-table__cell:not(.employees-table__cell--muted):not(a) {
    grid-area: dept;
  }

  .employees-table__row .employees-table__cell {
    background: transparent;
    padding: 0;
    border-radius: 0;
  }

  .employees-table__row .employees-table__cell--muted,
  .employees-table__row .employees-table__cell:not(a) {
    font-size: 13px;
    color: var(--color-text);
  }

  /* Forms list — stack person under document on HR view */
  .page-forms:not(.page-forms--employee) .forms-table__head {
    display: none;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row {
    grid-template-columns: 1fr 52px;
    grid-template-areas:
      "doc status"
      "person status";
    gap: 6px 10px;
    padding: 12px 14px;
    background: var(--color-white);
    border-radius: var(--card-radius);
    align-items: center;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row > .forms-table__cell:first-child {
    grid-area: doc;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row > .forms-table__cell:nth-child(2) {
    grid-area: person;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row > .forms-table__status {
    grid-area: status;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row .forms-table__cell {
    background: transparent;
    padding: 0;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row .forms-table__title {
    font-weight: 600;
  }

  .page-forms:not(.page-forms--employee) .forms-table__row .forms-table__cell:nth-child(2) {
    font-size: 13px;
    color: var(--color-text);
  }

  .page-forms:not(.page-forms--employee) .forms-table__row .forms-table__status {
    background: transparent;
    padding: 0;
    align-self: center;
  }

  .page-forms--employee .forms-table__head {
    display: none;
  }

  .page-forms--employee .forms-table__row:not(.forms-table__row--featured) {
    grid-template-columns: 1fr 52px;
    padding: 0;
    gap: 10px;
  }

  .profile-details {
    grid-template-columns: 1fr;
  }

  .profile-contracts {
    grid-column: 1;
    grid-row: auto;
  }

  .profile-save {
    grid-column: 1;
    justify-content: stretch;
  }

  .profile-save .btn {
    width: 100%;
  }
}
